Wednesday 15 August 2012

python - OR condition in XPath for Scrapy -



python - OR condition in XPath for Scrapy -

currently, stuck problem in xpath , scrapy have parse illustration this.

<dl class> <x class="another"><a>data 1</a></x> <y class="y"><b>data 2</b></y> </dl>

i want fetch info between , tag. so, wondering if there solution like

dl=response.xpath(".//dl") row in dl.xpath(".//a or .//b")

i want know if can set or condition.

use |:

dl.xpath(".//a | .//b")

python html xpath scrapy

No comments:

Post a Comment