Answer the question
In order to leave comments, you need to log in
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();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question