WhiteHatBox
Share Page
Following(0)
Partner(s)
toddhutch

I'm attempting to set a variable to a value on a loaded URL.

ReplyThanks 2015/11/24 17:09:08 0 0

I am looking to load in values from a table that has dynamic results which are always formatted with the same headers.


I'm not sure how to pull use the Regular Expression. I have a LinqPad 4 query that gives me the value, but I don't know how to apply it to the scrapper.


Regex.Match(new System.Net.WebClient().DownloadString("URL"), "offers.*?\\<td.*?\\<td.*?<td.*?\\<td.*?>(.*?)\\</td>", RegexOptions.Singleline | RegexOptions.IgnoreCase).Groups[1].Value

WhiteHatBox
2015/11/24 22:12:40

Sorry, can't understand your need very well.

you want to scrape and save values into a table Or you want to read from a file and save the data into a table?

Let's ROCK!
toddhutch
2015/11/24 22:29:49

I'm looking to take a value on a website and load them into a variable. I have a regular expression that provides me the value, if I use LinqPad, that evaluates all of the html that is sent down. Right now I'm Loading a URL, then scraping the page, on the scraping I'm hoping I can use my Regular Expression to get the value of the the field on the page that I need to load into a variable.



Regex.Match(new System.Net.WebClient().DownloadString("URL OF THE SITE"), "offers.*?\\<td.*?\\<td.*?<td.*?\\<td.*?>(.*?)\\</td>", RegexOptions.Singleline | RegexOptions.IgnoreCase).Groups[1].Value


    WhiteHatBox
    2015/11/25 02:08:59

    I think you just need do following steps>>

    1. use http action to get the source code of the site and save the code into a string variable.

    2. use the variable proccess action to deal with the string, there you can use the regex to deal with the string and get the result you want.


    Please let me know if it works for you after try this.

    Let's ROCK!
    << < 1> >>
    VerifyCode
    Advanced Option