ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   HTML Span (https://www.excelbanter.com/excel-programming/419606-html-span.html)

[email protected]

HTML Span
 
Hey,

I am trying to search the source code of a web page for a specific
span. I can use

objIE = CreateObject("InternetExplorer.Application")

objIE.document.Links.href

to find a link but I'm wondering if there is a way to do something
like

objIE.document.span("lblOwnersVal").Name

This is what the span looks like in the source code. I want to search
by the span ID and
return the name DOE, JOHN

<span id="lblOwnersVal" tabindex="-1" class="parceldetail"
style="height:10px;width:280px;Z-INDEX: 101; LEFT: 184px; POSITION:
absolute; TOP: 352px"DOE, JOHN </span

Any help would be appreciated.

Thanks,
Kyle

Andrew Taylor

HTML Span
 
I presume the line
objIE = CreateObject("InternetExplorer.Application")
should be
Set objIE = CreateObject("InternetExplorer.Application")

If I understand you correctly, you should be able to use
objIE.document.getElementById("lblOwnersVal").inne rHTML
to get the contents of the span element.

Andrew


On 6 Nov, 07:47, wrote:
Hey,

I am trying to search the source code of a web page for a specific
span. I can use

objIE = CreateObject("InternetExplorer.Application")

objIE.document.Links.href

to find a link but I'm wondering if there is a way to do something
like

objIE.document.span("lblOwnersVal").Name

This is what the span looks like in the source code. I want to search
by the span ID and
return the name DOE, JOHN

<span id="lblOwnersVal" tabindex="-1" class="parceldetail"
style="height:10px;width:280px;Z-INDEX: 101; LEFT: 184px; POSITION:
absolute; TOP: 352px"DOE, JOHN * * * * * </span

Any help would be appreciated.

Thanks,
Kyle



[email protected]

HTML Span
 
Thank you for your response, that is exactly what I was looking for.


All times are GMT +1. The time now is 12:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com