XPath Assistance
Issues related to W3C XQuery.
-
- Posts: 1
- Joined: Sat Oct 09, 2021 4:01 pm
XPath Assistance
Hi all,
I'm trying to build a Google Sheet to bring in column data from a webpage, via the "ImportXML" function.
The HTML snip is below.
After reading up a little on XPath, I have tried :
"//*[@id="results"]/td[1]"
To grab all the data from the first column - but am getting an error.
This:"//td[1]"
Returns patchy data results, as I believe it is too general, i.e. there are other tables on the page.
It is just the column data in the table within <DIV> with an id='results', that I'm interested in.
Full URL (if needed): https://rgtdb.com/events/112484
Thanks in advance
Jim
I'm trying to build a Google Sheet to bring in column data from a webpage, via the "ImportXML" function.
The HTML snip is below.
After reading up a little on XPath, I have tried :
"//*[@id="results"]/td[1]"
To grab all the data from the first column - but am getting an error.
This:"//td[1]"
Returns patchy data results, as I believe it is too general, i.e. there are other tables on the page.
It is just the column data in the table within <DIV> with an id='results', that I'm interested in.
Full URL (if needed): https://rgtdb.com/events/112484
Thanks in advance
Jim
Code: Select all
<div class="tab-pane active" id="results" role="tabpanel">
<table
data-classes="table table-striped table-hover"
data-toggle="table"
data-search="true"
data-pagination="true"
data-page-size="50">
<thead>
<tr>
<th class="text-center" scope="col">#</th>
<th scope="col"></th>
<th scope="col">Name</th>
<th scope="col">Finish Time</th>
<th scope="col">Avg wKg</th>
<th class="text-center" scope="col">Rank Change</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-center">
1 </td>
<td>
🥇
</td>
<td> <span class="align-middle">
<i style="font-size: 15px; color: #B1B1B1" class="fas fa-dot-circle" data-toggle="tooltip" title="SILVER"></i>
<a class="text-primary" href="/user/49030">Mads Bang</a>
</span>
</td>
<td>
1:54:40.4 <em class="small"></em>
</td>
<td>
4.09 </td>
<td class="text-center">
<span style="font-size: 1.4em;"><i class="fas fa-arrow-up"></i></span>
</td>
</tr>
You do not have the required permissions to view the files attached to this post.
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: XPath Assistance
Hi,
Are you using Oxygen XML Editor to run the xpath? What error do you get when running the first xpath?
Maybe this xpath would be better for what you want: //*[@id="results"]//td[1]
Regards,
Radu
Are you using Oxygen XML Editor to run the xpath? What error do you get when running the first xpath?
Maybe this xpath would be better for what you want: //*[@id="results"]//td[1]
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service