user2196600
user2196600

Reputation: 89

Why xpath text() node cannot be nested in Scrapy

I encounter a problem when playing around xpath selector.

response.xpath('//*[text()="Revenue"]/text()/.')


response.xpath('//*[text()="Revenue"]/text()').xpath('.')

I was expecting two codes above output the same thing. The first one works fine,but the second one returns an empty list.

Upvotes: 1

Views: 29

Answers (1)

Gallaecio
Gallaecio

Reputation: 3857

This is a known issue, there is a feature request to get selectors of text to behave as any other selectors (parsel #130).

Upvotes: 1

Related Questions