Extracting text that is not in tags. /text() not working in x-path
I'm trying to extract some text, without the sibling and child elements.
However, I can't seem to do so.
/text() doesn't seem to work in Octoparse.
Sample code:
<div class="f-address">
10 Sunray Street, Unit 7, Whitby, Ontario L1N 8Y3
<span style="display:block">
(905) 809-9236
<p></p>
<div class="dir-excerpt">
<p>%Description text%</p>
</div>
</span>
</div>
And here is my x-path:
//*[@class='f-address']/span/text()
The result is that it scrapes EVERYTHING inside the SPAN, not just the phone number which I'm looking for.
-
Official comment
Hi level42,
Thank you for reaching out.
Please submit a ticket through https://helpcenter.octoparse.com/hc/en-us/requests/new with the task attached. So we can help you revise it.
Please follow the instructions in this tutorial to export the task: How to export a task?
Cheers,
Comment actions
Please sign in to leave a comment.
Comments
1 comment