View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default retrieving list items from ordered list in HTML

There may be a property href that has the daa you are looking for. I often
set break point and watch items to troubleshgoot these type problems

set itm = getelementsbytagname="OL"
a = 1 'set break point on this line and then add a watch to the variable
itm.

You can set the watch by right clicking on "ITM" and then select Add Watch.


another method that sometimes helps is dumping the webpage into the workbook
like this

RowCount = 1
for each itm in IE.document.all
Range("A" & Rowcount) = itm.tagname
Range("B" & Rowcount) = itm.classname
Range("C" & Rowcount) = itm.id
Range("D" & Rowcount) = left(itm.innertext,1024)

RowCount = rowCount + 1
next itm

" wrote:

hello

I am using the getelementsbytagname="OL" method(?) to capture items in
an ordered list. Each list item is an anchor and a label (link to
another web site). I want to capture the label but not the anchor. I
am not sure how to use innertext to capture one part versus the
other. when capturing table data I can do this with .Rows(j).Cells
(0).innertext not sure what to do with a LI

tia