Mark Weerasinghe Mark Weerasinghe - 1 year ago 92 Question

( Web Scrapping Issue

Would like some help with a small issue i can't figure out

I simply need to display this in a Richtext box instead of a MsgBox, But when i do i only get one line of text (in this case only the first sentence)

For each node in nodes
richtextbox3.text = node.innertext

^^^^ This doesn't work,Any help much appreciated.

Private Sub Scrape()
Dim req As WebRequest = WebRequest.Create("")
Dim doc As New HtmlDocument()
Using res As WebResponse = req.GetResponse()
End Using

Dim nodes = doc.DocumentNode.SelectNodes("//p[@class='verse']")
If nodes IsNot Nothing Then
For Each node In nodes
End If
End Sub

Answer Source

Don't you have to;

For each node in nodes 
    richtextbox3.text += node.innertext

Because you are replacing the new line each time.

And I really think this is a bad question, you didn't do any research nor 'undressing' the problem (go to the core of the problem and leave other code around it). Nobody else is going to benefit from this question, and the title doesn't match the problem

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download