getelementsbytagname question

D

Danny

I am trying to read an html file and get the info from a table. I am able
to extract the tables via
test = getelementsbytagname ("table")
then I do
for x = 1 to test(length)
msgbox x.innertext
msgbox x.innerhtml

next x

but how can I access the elements within this innertext or innerhtml.
I would like to see some of the img, td, tr tags within the table tag but I
dont know how to access them.

I would appreciate your help

Thanks
 
W

wooks

Danny said:
I am trying to read an html file and get the info from a table. I am able
to extract the tables via
test = getelementsbytagname ("table")
then I do
for x = 1 to test(length)
msgbox x.innertext
msgbox x.innerhtml

next x

but how can I access the elements within this innertext or innerhtml.
I would like to see some of the img, td, tr tags within the table tag but I
dont know how to access them.

I would appreciate your help

Thanks

1. Question has nothing to do with XML (unless you wish to use XSLT to
extract the data in which case you have to make sure the HTML
constitutes well formed XML (XHTML).
2. To do things the way you seem to want to you need to familiarise
yourself with the Document Object Model. There is plenty of material
available on the web.
3. shouldn't the code read for x = 1 to test.length
4. getElementsByTagname will return a node collection which you can
then access via DOM properties and methods (childnodes, nextnode etc).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top