How to get InnerText of IFrame from another site?
- by Eclipsed4utoo
I am trying to do some screen-scraping of a website. The content that I want to get is inside of an IFrame. How do I get the InnerText or HTML that is being displayed inside of the IFrame?
I am using .Net 4.0 and C#. I want to be able to do this from a WinForm.
I tried this, but can't find where to get the actual data from...
void PageCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
WebBrowser b = sender as WebBrowser;
string response = b.DocumentText;
HtmlElement element = b.Document.GetElementById("profileFrame");
if (element != null)
{
// do something with the data
}
}
I've tried searching through the element but couldn't find any of the HTML. Is this possible?