V
V
VirusesAnalystCoder2020-06-19 18:07:32
C++ / C#
VirusesAnalystCoder, 2020-06-19 18:07:32

WebClient. Wait for page initialization/loading?

Hello!
I have a page that needs to be parsed, but the fact is that when you go to it, it first loads for 5-6 seconds, and then only the page is shown. When parsing - there are no necessary elements, because they are not loaded yet.
How to load in WebClient without using Selenium?
the code:

string page = "";
            WebRequest request = WebRequest.Create(ethusd);
            request.Credentials = CredentialCache.DefaultCredentials;
            

            WebResponse response = request.GetResponse();
            using (Stream dataStream = response.GetResponseStream())
            {
                StreamReader reader = new StreamReader(dataStream);
                string responseFromServer = reader.ReadToEnd();
                reader.Close();
                page = responseFromServer;
            }

            response.Close();

here I get the page code into the page variable

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
itgood, 2020-06-22
@itgood

most likely js scripts are not loaded, you need to execute them to get the content from the page

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question