0

i'm working with the webkit open source engine browser in visual basic. I'd like to obtain the html tags conteined in the loaded web page, but when i try to use the GetElementsByTagName comand, it returns always nothing.

Do you have any ideas?

thanks in advance. Massimo

Massimo
  • 33
  • 1
  • 5

2 Answers2

2

I am not sure about VB, but I did the same thing using C# in the following way:
WebKit.DOM.Document doc1 = webKitBrowser1.Document;
WebKit.DOM.NodeList tags = doc1.getElementsByTagName("input");

Now, we can access each tag from the NodeList tags using index values, as:
WebKit.DOM.Element elm = (WebKit.DOM.Element)tags[index];

To adapt the above method in VB, you just have to change the Variable types. Concept will remain same.

Anshul
  • 234
  • 2
  • 16
0

Perhaps your capitalization is wrong? Try...

alert(document.getElementsByTagName("div"));

or console.log(document.getElementsByTagName("div")) if you are familiar with Safari/Chrome's Web Inspector.

methodofaction
  • 70,885
  • 21
  • 151
  • 164
  • I don't know Duopixel when the document is complete loaded, i've defined a variable like this one: dim x1 = webkitbrowser.document then i've defined another one in this mode dim x2 = x1.getElementsByTagName("href") and then for each x3 in x2 ----code---- next but the loop extracts nothing, only when i insert body instead of href, it works.... thank. Massimo. – Massimo Jan 28 '11 at 07:44