Artemis
Artemis

Reputation: 133

Get the contents of a specific attribute in span tag

I have the following html:

<span class="price" itemprop="price" content="2349.00">
                2&nbsp;349&nbsp;KČ            </span>

I need to get the contents of the content attribute ("2349.00"), is this possible with scrapy?

I have tried the following:

response.css('span.content').get()

but obviously it didn't work.... is it possible to reference to other attributes similat as the class name and get their contents??

Upvotes: 0

Views: 65

Answers (1)

vezunchik
vezunchik

Reputation: 3717

Try:

response.css('span::attr(content)').get()

Upvotes: 1

Related Questions