初始化一个项目

scrapy爬取多页数据

新建一个爬虫文件

scrapy爬取多页数据

要爬取的网页

scrapy爬取多页数据
- 在a标签上右键 copy >>> copy xPath 复制到剪切板的是如下内容
/html/body/div[2]/div[2]/div[1]/div[4]/ul/li[2]/a

获取所有的需要爬取的页面url

scrapy爬取多页数据

  • scrapy runspider getNews.py -o newsData.json
    scrapy爬取多页数据

编写解析函数

scrapy爬取多页数据

  • scrapy runspider getNews.py -o newsData.json
    scrapy爬取多页数据

相关文章:

  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2022-01-02
猜你喜欢
  • 2022-12-23
  • 2021-05-05
  • 2021-11-09
  • 2022-12-23
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案