mute-gold•4y ago
How to get only what's after html tag?
How to scrape only what's after the html tag <label>?
(e.g. text after label 1, text after label 2)
<div>
<label>some label 1</label>
text after label 1
</div>
<div>
<label>some label 2</label>
text after label 2
</div>
3 Replies
under cheerioCralwer
$('table').html()genetic-orange•4y ago
I'd recommend doing something like this:
The output of this code is:
mute-goldOP•4y ago
Thanks for the answers, I will try it soon.
But how can I do this in the code?
const $ = load(
<div>
<label>some label 1</label>
text after label 1
</div>
<div>
<label>some label 2</label>
text after label 2
</div>);
I don't know what is the text in each page, this was just an example text, but the text in each page is different.