Hey guys ! This is on what I'm working on :
Dim url As String = "http://brayket.byethost9.com/index.php?/shoutbox/"
Dim web As New HtmlWeb()
Dim doc As HtmlDocument = web.Load(url)
Dim names As HtmlNodeCollection = doc.DocumentNode.SelectNodes("//span[@class='shoutbox_text']")
Console.WriteLine(names)
System.Threading.Thread.Sleep(100000000)
I'd like to write on the console everything that's between "<span class="shoutbox_text">
" and </span>
Hope I'll find some help here :)
1 Answer 1
Dim url As String = "http://brayket.byethost9.com/index.php?/shoutbox/"
Dim web As New HtmlWeb()
Dim doc As HtmlDocument = web.Load(url)
Dim names As HtmlNodeCollection = doc.DocumentNode.SelectNodes("//span[@class='shoutbox_text']")
'**Place the code below to read each values between selected nodes.**
For Each useAnyWantedWordHere in names
console.writeline(userAnyWantedWord.InnerText & vbcrlf)
Next
Console.ReadLine()
If you want to make it work with a textbox or richtextbox this is the code :
For Each AnyWantedWord in names
richtextbox1.AppendText(AnyWantedWord.InnerText & vbCrLF)
Next
Console.WriteLine(names.InnerText)
?console.writeline(names.count)
it shows the right amount of span class"shoutbox_text" in the html code. But I can't manage to show what are these classes >< (By the way, I'm using HtmlAglityPack)code
Dim web As New HtmlWeb() Dim doc As HtmlDocument = web.Load(url) Dim row = doc.DocumentNode.SelectNodes("//tr[@class=""row2""]") for each xName in row console.writeline(xName.innertext)code
And it works :)