有2个常有插件,一个是xpath checker,一个是firepath(配合firebug)

xpath checker是个好东西,不仅可以分析,还可以验证自己抽取的xpath是否正确

但xpath checker 是遵从xpath2.0 , 而scrapy则是遵循xpath1.0,因此会出现不兼容的情况。

使用过程中我就遇到了xpath checker中正常获取但是在scrapy程序中无法正常解析的情况。

信息源自:https://groups.google.com/forum/#!msg/scrapy-users/5qdzooT8RXg/Ttvm4ublTu0J

 

建议使用firepath,这个插件是支持xpath1.0的

 

同时火狐firefox会添加tbody标签,在使用scrapy时候需要将分析出的xpath中的tbody标签去掉。

http://doc.scrapy.org/en/latest/topics/firefox.html

相关文章:

  • 2021-12-13
  • 2021-08-27
  • 2022-12-23
  • 2022-01-03
  • 2022-01-03
  • 2022-12-23
  • 2021-11-30
  • 2021-12-10
猜你喜欢
  • 2022-02-16
  • 2022-12-23
  • 2022-01-03
  • 2021-06-19
  • 2021-11-27
相关资源
相似解决方案