http://scrapy-chs.readthedocs.io/zh_CN/0.24/intro/tutorial.html

 

scrapy 提取html的标签内容

from scrapy.selector import Selector

selector = Selector(response)
ul = selector.xpath('//ul[@class="movieList"]')

要获取class包含test的所有div,比如<div class="test website"></div>

把上述xpath的参数修改为 "div[contains(@class,'test')]" 即可。

参考:http://blog.csdn.net/iefreer/article/details/20745065

 

相关文章:

  • 2021-10-04
  • 2021-12-20
  • 2021-12-25
  • 2021-07-24
  • 2022-02-07
  • 2022-01-15
  • 2021-08-21
  • 2022-01-18
猜你喜欢
  • 2021-12-29
  • 2021-04-27
  • 2021-11-07
  • 2021-12-22
  • 2022-03-07
  • 2021-11-20
相关资源
相似解决方案