Open GoogleCodeExporter opened 9 years ago
The error "object does not support this property or method" is because VBA
doesn't know what "[4]" is. To select an element in an array in VBA, you need
to use parenthesis.
A correct syntax would be:
document.getElementsByTagName('table')(5).getElementsByTagName('a')(4).getAttrib
ute('href')
But this is not recommended as it implies multiple calls and unnecessary data
are imported.
A better syntax would be to use XPath (:
document.getElementsByXPath('//table[5]//a[4]').getAttribute('href')
Original comment by florentbr
on 7 Oct 2014 at 6:11
Great , thanks a lot , what about the first question please:
how can i write this in VBA
document.getElementsByTagName('table')[5].getElementsByTagName('a').length;
I want to count how many tagname 'a' exist in table(5)
Thanks a lot again :)
Original comment by alam...@gmail.com
on 7 Oct 2014 at 8:13
len = document.getElementsByXPath('//table[5]//a').Count
Original comment by florentbr
on 7 Oct 2014 at 10:40
Original issue reported on code.google.com by
alam...@gmail.com
on 6 Oct 2014 at 7:28