Answer the question
In order to leave comments, you need to log in
How to extract only text from css element?
Text "Karambit - 5.00
Raise your account ratingfff."
I need to collect, without a link, via xpath( //div|br ) it works like this - Karambit - 5.00 https://ali.ski/-5dDY0Raise your account ratingfff.
how to choose the right xpath request so that only the text is taken? (
https://vk.com/aliexpressvramkaxzakona52 - link with the page code.
Answer the question
In order to leave comments, you need to log in
Firstly, it's completely unnecessary to bother with xpath when VKontakte has an API that allows you to parse a wall.
Secondly, the link is easily cut off by a regular expression by type
^(https?:\/\/)?([\w\.]+)\.([a-z]{2,6}\.?)(\/[\w\.]*)*\/?$
<div id="mydiv">
some text <a href="#">super link</a> la la la
</div>
string(//div[@id="mydiv"])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question