Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15406

VS 2019 Reading text from a website

$
0
0
Hi

I need to read the text of a web page from vb.net

In the past I've done this by navigating to the url via a webbrowser control, waiting for the DocumentCompleted event, and then looking at WebBrowser1.Document.Body.InnerText

The problem I have is that I've been asked to look at a page which uses javascript to create some variable text. I don't know javascript at all, but these seem to be the relevant lines:

Code:

Hello! You recently spoke to <b>*insert name of Canvasser*</b> about
....
var node = document.getElementById('dvwith');               
var a= node.innerHTML.replace("*insert name of Canvasser*", _canvass.display_text);
document.getElementById('dvwith').innerHTML =a;
jQuery("#dvwith").css("display","block");
jQuery("#dvwithout").css("display","none");


I need to read the text which replaces '*insert name of Canvasser*'. It's to test the page has rendered properly, so I need to capture the final text, after the replacement has been done.

Unfortunately I can't get the page to show properly in the webbrowser control - I can see the rest of the page, but the variable text doesn't display at all, so I assume the script is not running properly (I get errors when I set ScriptErrorsSuppressed = False on the browser control).

Can anyone suggest a way forward with this? - I just need a way for the browser to show the page in it's final state so I can then grab the text and do a search on it to get what I want.

Thanks

Viewing all articles
Browse latest Browse all 15406

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>