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
rival-black•3y ago
under cheerioCralwer
$('table').html()
robust-apricot•3y ago
I'd recommend doing something like this:
The output of this code is:
harsh-harlequinOP•3y 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.