I was wondering if anyone can show me how to extract text from a website.
I have seen lots of ways to get the html source, then go through the tags, but the problem is that the text displayed on the webpage is taken from a javascript function.
Is there anything which can render the page, then allow me to extract the textual content?
cheers
Extracting text from webpage (dynamic text from JS, not in html source)
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Bechir BejaouiRank #144 · 15.9K pointsPosted Jan 27, 2009, 12:24 PM EST
WebClient webClient = new WebClient();
string url = "http://www.c-sharpcorner.com/";
byte[] request = webClient.DownloadData(url);
UTF8Encoding utf = new UTF8Encoding();
TextBox.Text = utf.GetString(request);