I used your code for testing, but the code still cannot meet this judgment condition, so I removed it.
if (webBrowser1.ReadyState == WebBrowserReadyState.Complete && IsRedirect)
Then I found that the two links in the code could not get the h1 element, because they did not have this tag in the source code, and then I tested it with other links, and successfully got the element after entering the webBrowser1_DocumentCompleted method every time.
private void Form1_Load(object sender, EventArgs e)
{
urls.Add("https://bing.com");
urls.Add("https://csharp.net-tutorials.com/linq/linq-query-syntax-vs-method-syntax/");
DataCount = urls.Count;
}
Are you sure you used the site in the example when you got h1?
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
can you please share some url where data load by ajax. thanks
@T.Zacks
Sorry, I don’t know, I haven’t noticed whether the website I’m browsing uses Ajax.