Webkit document and GetElementsByTagName

3k views Asked by At

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

2

There are 2 answers

1
methodofaction On

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.

0
Anshul On

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.