0
点赞
收藏
分享

微信扫一扫

scrapy 爬虫框架简单使用

目标践行者 2022-12-06 阅读 78


前提需要安装scrapy 这个框架 

爬取公司简介
1.scrapy shell  http://static.wealthbetter.com/about

2.response.xpath ('//dl[@class="a_about_item clearfix"]/dd/text()').extract() //匹配任意节点是dl带class的文字

  爬取公司动态信息
1.http://static.wealthbetter.com/article/list/1

2.response.xpath ('//div[@class="news_list_con"]/p/text()').extract()

response.xpath ('//div[@class="none_class news_item"]/div/div/text()').extract()

3.爬取新浪财经新闻
scrapy shell https://finance.sina.com.cn

scrapy shell https://finance.sina.com.cn/stock/

举报

相关推荐

0 条评论