1. Set hr = hDoc.body.getElementsByTagName("table table-striped table-bordered table-hover")
2. set hrr1 = hr.getElementsByTagName("th") 'error this line
Line 1 returns a
HTMLCollection - Web APIs | MDN[
^] of all elements that have the named tagid. But the
HTMLCollection
does not have a
getElementsByTagName
method.
Also, if the length field of item hr is zero then it means that no items were found with that tag. And in your code you are trying to refer to it by the name of its
class
, rather than the
HTML
tag name. See
Document.getElementsByClassName() - Web APIs | MDN[
^].