I need to retreive results from a website into my ASP.NET (c#) application. (the required data are soccer fixtures results).
For what I’ve come to realize, I need to somehow use the “ViewState” right?
I actully need to somehow “right-click” the website and “select” “view source”.. (I need this process to be executed automatically)
Can someone please explain to me how I can achieve that?
You don’t need to worry about ViewState because it will be rendered on the page as a hidden html element with its corresponding value.
You can simply do this (taken from MSDN):
When you run above code you’ll see that
downloadhas the actual html content, which is what you want.Now, it seems that what you really need is an HTML parser that can allow you to get the content of specific section of page and do something with it. For that, the most popular tool is HTMLAgility pack. Examples provided on the website.