Question Get text from webpage but not the easy one ;)

zola320

Member
Joined
Apr 15, 2012
Messages
7
Programming Experience
Beginner
Im know 2 days working on solving this problem but seems that i found my master :)

Here is the problem:
I need to get some text from this web page ==>> eToro Open Book
I want to use the trade feed for my program to analyse the sentiment of the markets.

I used the browser control and the get element command but its not working.
The problem is that whenever my browser starts to open the page I get java scripts errors.
Every help is welcome :)

Guys you are my last hope :)
Pleas Helpppp!!!
Tnx
 
On java embedded pages, use 'DOMDocument' property and iterate through each element using for-each

debug.print it the structure and from them use your logic to assemble the necessary portion to use with your commands

Document property is static, Means it displays the Base HTML page only. Dynamic HTML issued by client side java Script could not be accessible from Document proerty

Still this kind of programming are Trial and Error, You have to do more testing...
 
Using client As New WebClient

Dim htmlDocument As mshtml.IHTMLDocument2 = client.OpenRead("http://openbook.etoro.com/alemzolota/#/profile/Trades/")
Dim allElements As mshtml.IHTMLElementCollection = htmlDocument.body.all
Dim divs As mshtml.IHTMLElementCollection = allElements.tags("div")
For Each element In divs
If element.name.contains = "content" Then
MsgBox("contetn found")
End If
Next

End Using

Am I on the right way ? or was this just waist of time :)
 
This is what I have build up until now its working but not giving any output ?

Dim code As String
Using client As New WebClient

code = client.DownloadString("http://openbook.etoro.com/alemzolota/#/profile/Trades/")
End Using

Dim htmlDocument As IHTMLDocument2 = New HTMLDocument(code)
htmlDocument.write(htmlDocument)
htmlDocument.close()

Dim allElements As IHTMLElementCollection = htmlDocument.body.all

Dim allInputs As IHTMLElementCollection = allElements.tags("input")
Dim element As IHTMLElement

For Each element In allInputs
element.title = element.innerText
MsgBox(element.innerText)

Next
 
I searched a bit around and this is what i have now but still not solving my problem:

Dim plain As String = String.Empty
Dim htmldoc As New HtmlAgilityPack.HtmlDocument
htmldoc.LoadHtml("http://openbook.etoro.com/ahanit/#/profile/Trades/")
Dim goodnods As HtmlAgilityPack.HtmlNodeCollection = htmldoc.DocumentNode.SelectNodes("THE PROBLEM")

For Each node In goodnods
TextBox1.Text = TextBox1.Text & htmldoc.DocumentNode.InnerText
Next

Thank you
 
Back
Top