火狐firefox插件配合scrapy,注意tbody会导致empty

有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

原文地址:https://www.cnblogs.com/phoenix--/p/3522150.html