문제

With Scrapy, the following extract works ok just for normal text. It excludes all the BOLD tags that I am trying to retrive:

hxs.select('//td[@class="Info_Cell"]/text()').extract()

The following just extracts the BOLD text, but excludes normal text.

hxs.select('//td[@class="Info_Cell"]/b/text()').extract()

How would you extract Text, normal and with Bold tags.

도움이 되었습니까?

해결책

In general // will extract recursively all child nodes, so in your case you need:

hxs.select('//td[@class="Info_Cell"]//text()').extract()
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top