I have been recently working in downloading webpage content using WebClient in C#. The DownloadString
method of WebClient can not download the content from iframe.
The short code for downloading content has been used as:
using (var client = new WebClient())
{
string html = client.DownloadString("url");
}
What should I need to use for reading iframe content in C#?
For Testing, I am using http://multiprofits.co.uk/oddsmatcher.html site which has iframe in it.
You have to search for the iframe tag in the main page and then take the src attribute to download the page in the iframe
For the regex you could use this Regular Expression to get the SRC of images in C#
Edit :
You really get the iframe source with this code
Edit2 :
I have found your problem. It's a security issue from the site. Launch the iframe url in a new browser you will receive this message :
oddsmatcher is not permitted to run on this domain name [v2.oddsmatcher-data.co.uk/v2.oddsmatcher-data.co.uk] For more details please cotact support@oddsmonkey.com
So you must can't download directly the iframe source. You probably have to use WebBrowser or something like this