![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
爬虫
文章平均质量分 88
木玉曾有约
我就是我
展开
-
爬虫之爬取网页表格数据(四)
使用BeautifulSoup、pandas解析网页,爬取数据目标网站:http://s.askci.com/data/economy/00002/1/第一种解析方法:使用BeautifulSoup代解析网页import requestsimport urllib3urllib3.disable_warnings()from bs4 import BeautifulSoupfrom urllib.parse import urlencodefor i in range(1,3):原创 2020-07-01 00:08:37 · 850 阅读 · 2 评论 -
爬虫之爬取网页表格数据(三)
爬虫之爬取网页表格数据(三)爬虫之爬取网页表格数据(二)只是爬取到一条数据,如果想爬取多条数据该怎么做呢?只需要修改spider下example.py文件的代码即可如下:`def parse(self, response): # housename = response.xpath('//*[@id="content"]/div[1]/ul/li[1]/div[1]/div[1]/a/text()').extract_first() # price = response.xpath(原创 2020-06-30 22:59:50 · 1129 阅读 · 0 评论 -
爬虫之爬取网页表格数据(二)
爬虫之爬取网页表格数据###环境:Anaconda2虚拟环境步骤1打开Anaconda Prompt命令行窗口,输入conda activate tfenv激活虚拟环境,进入所要创建爬虫项目的文件夹,比如说我在F:\hadoop\python-project目录下创建爬虫项目。输入scrapy startproject firstspider创建firstspider项目步骤2在pycharm中打开刚新建的项目,目录结构如图所示spiders:这里面写爬虫程序items:写实体( pyt原创 2020-06-30 22:34:15 · 2879 阅读 · 2 评论