Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default retrieving list items from ordered list in HTML

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default retrieving list items from ordered list in HTML

It would help if you could post the HTML (a small example) for the OL
element.

Tim


wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create an ordered list from 2d array MarkBrazier Excel Worksheet Functions 6 August 3rd 09 04:22 PM
Compare List A to List B, Return List B Items Not in List A zwestbrook Excel Programming 4 September 18th 08 10:32 PM
How can I input an ordered or bulleted list in a XL cell Z28 Excel Discussion (Misc queries) 2 July 27th 07 02:01 AM
extract data from a random list & place in another ordered list sean8690 Excel Discussion (Misc queries) 1 January 2nd 07 06:06 PM
generating rank-ordered list [email protected] Excel Discussion (Misc queries) 4 November 13th 06 12:48 PM


All times are GMT +1. The time now is 06:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"