Answer the question
In order to leave comments, you need to log in
Scrapy. How to display the contents of a tag without the tag itself?
Good evening.
There is an HTML page. It has a code
<div class="price">
<strong>
€
<span>18.200,-</span>
</strong>
In [47]: response.xpath("//div[@class='price']/strong/span.extract()
Out[47]: ['<span>18.200,-</span>']
Answer the question
In order to leave comments, you need to log in
response.xpath("//div[@class='price']/strong/span/text()".extract()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question