Webbrowser documenttext not updating
Document Text doesn't get updated and the code throws exception on line foreach (Html Agility Pack. Give sometime after invoking submit "Click" option and try.
Here is the code: After invoking "Click" the webbrowser1. Select Nodes("//table[contains(@id,'_grdvw Attendance')]")) since it is not able to find the element on the page. The problem could be that you are trying to get the content prior to it is completing (i.e before post method returning the result) submit request and response.
Document Text: "If you set the value of this property and then immediately retrieve it again, the value retrieved may be different than the value set if the Web Browser control has not had time to load the new content." Maybe this also applies to if you set an element's ID and then immediately read the Document Text property?
, then do some HTML parsing to extract the information I need.
After adding other records, the user clicks a button in my program and it will do the work again: navigate to the URL, extract HTML, parse it and do stuff.
What is happenning: in my computer it works fine, but to some others the refresh/navigate again doesn't catch the new records.
Document Text with the HTML string I was returning.
Now I set it up to grab all of the information on the client, without ever having to hit the server, and I'm trying to raise the same event.
So I can see the changes made in the browser but I can't save them or load them into a textbox! The DOM elements appear to update but the Document Text method doesn't update or grab what's being added to the page.
If you set the value of this property and then immediately retrieve it again, the value retrieved may be different than the value set if the Web Browser control has not had time to load the new content.
You can retrieve the new value in a Document Completed event handler.
But since I'm using Document Text to give the Html code to Html Agility Pack, Html Agility Pack is not getting the unique Id's.
The reason why I need to map from one to another is because I'm creating a web Scrapper that will update the visual aspects of a web page according to selections the user do (highlight stuff, etc.), but I need to keep a copy of the original html to do the actual scrapping, otherwise the scrapping will be messed up by the changes I make to the html. Maybe you need to wait for some time to pass..MSDN on Web Browser.