1
Good night,
I have a task to be able to create a desktop application to read the HTML of a page. With some searches I managed to create a method that reads the HTML and returns me a string, follows the code:
string strSiteUrl = "URL";
request = (HttpWebRequest)WebRequest.Create(strSiteUrl);
response = (HttpWebResponse)request.GetResponse();
stream = response.GetResponseStream();
streamReader = new StreamReader(stream);
pereira.txbDescricaoPagina.Text = streamReader.ReadToEnd();
My problem is that the page I need to read is dynamically loaded via javascript, that is, HTML is dynamically injected into the page and my method cannot see HTML.
Any help is welcome.
you have to add a Webbrowser, and wait for the page to load
– Rovann Linhalis
Hi Rovann, could you explain to me in more detail how I would use Webbroser within a descktop application?
– Hudson S. Carlos
@Joaomartins answered, that’s basically it... only after Documentcompleted, it is necessary to wait for javascript to load everything... in this case, a timer and a content check to see if it is ready
– Rovann Linhalis