matthewmueller / x-ray

The next web scraper. See through the <html> noise.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get a specific SPAN ID

benSmith1981 opened this issue · comments

This is the extract from the webpage:

<h4 class="username">
<span id="ctl00_ctl00_ctl00_cphMain_cphMiddle_cphLeftColumn_widgetDiveSiteProfile_lblSiteName">
Tiger Beach
</span>
</h4>

I want to extract "Tiger Beach". What is syntax I used to get this?

span[id]
But how can I get the text for this specific Span ID so not jsut all of them? I want to avoid doing a string search through all the Span IDs returned, and I just want this one for this ID?

"ctl00_ctl00_ctl00_cphMain_cphMiddle_cphLeftColumn_widgetDiveSiteProfile_lblSiteName"
I can't find anywhere in the documentation or an example how to solve this (relatively simple) problem
Thanks

Solution: You want the contents so between > < of a span id of "star5" do this
span[id="star5"]