質問

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