scrapy and xpath function 'matches' syntax

后端 未结 2 872
挽巷
挽巷 2021-01-06 17:20

I\'m running scrapy 0.20.2.

$ scrapy shell \"http://newyork.craigslist.org/ata/\"

I would like to make the list of all links to advertiseme

2条回答
  •  我在风中等你
    2021-01-06 17:48

    matches is an XPath 2.0 function, and scrapy only supports XPath 1.0 (which does not have any regular expression support built in). You'll have to extract all the links using a scrapy selector and then do the regex filtering at the Python level rather than within the XPath.

提交回复
热议问题