GroundControl_852

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2020年6月22日

摘要: 阅读全文
posted @ 2020-06-22 15:10 GroundControl_852 阅读(170) 评论(0) 推荐(0) 编辑

2020年6月21日

摘要: 1.创建数据库 show DATABASES; create database test default charset utf8; use test; View Code 2.创建数据表 -- 1.创建表table create table class( cid int auto_incremen 阅读全文
posted @ 2020-06-21 21:15 GroundControl_852 阅读(174) 评论(0) 推荐(0) 编辑

2020年5月16日

摘要: - 需求 爬起链家深圳二手房的详情信息,存储到excel表中.并对深圳二手房数据进行分析 以下数据只是简单的获取第一页的二手房源信息,通过xlwt写入excel并保存 from lxml import etree import requests import xlwt import re # 1.构 阅读全文
posted @ 2020-05-16 14:31 GroundControl_852 阅读(320) 评论(0) 推荐(0) 编辑

2020年5月8日

摘要: 豆瓣电视剧爬虫 # coding=utf-8 import requests import json class DoubanSpider(): def __init__(self): self.url_temp_list=[ {"url_temp":"https://m.douban.com/re 阅读全文
posted @ 2020-05-08 17:12 GroundControl_852 阅读(342) 评论(0) 推荐(1) 编辑

摘要: 爬取思路 清楚爬取需求,我们要爬取电影名字,导演名字,电影上映时间,电影类型,制片国家,评分人数和电影简介 首先从网页上分析,网页数据不是由ajax抓取,因此我们直接用这个网站url发送请求获取数据,从网页源码上看我们可以从第一层网页中获取到影名字,导演名字,电影上映时间,电影类型,制片国家,评分人 阅读全文
posted @ 2020-05-08 16:52 GroundControl_852 阅读(340) 评论(0) 推荐(0) 编辑

2020年4月22日

摘要: scrapy框架 架构 爬虫文件夹:spider 管道文件: pipelines.py 中间件文件: middlewares.py item模块:items.py 设置文件 :settings.py 相关命令 创建scrapy项目:scrapy startproject 项目名 创建爬虫文件: cd 阅读全文
posted @ 2020-04-22 21:42 GroundControl_852 阅读(233) 评论(0) 推荐(0) 编辑

2020年4月11日

摘要: 爬取思路:- 1.分析网站是否ajax解析数据,清除页面刷新网站,看XHR有没有对应的网站,发现为空,表明数据不是由ajax数据解析来的,我们可以直接由网站url来抓取数据,即 url = "https://www.pearvideo.com/category_4" 顺便获取headers head 阅读全文
posted @ 2020-04-11 10:46 GroundControl_852 阅读(174) 评论(0) 推荐(0) 编辑

2020年4月2日

摘要: 注意事项:- 1.模拟登陆的请求参数有些是动态的,需要从页面源码中动态解析获取- 2.下载图片最好是用requests来下载,而不是urllib,他是会带上ua信息- 3.使用Session去自动处理cookie请求 import requests from lxml import etree fr 阅读全文
posted @ 2020-04-02 21:00 GroundControl_852 阅读(393) 评论(0) 推荐(0) 编辑

2020年4月1日

摘要: 以下将从处理cookie的两种方式来分析爬取雪球网的新闻数据, 一个是手动处理cookie,到源码去抓包,找到他的request header里面的cookie,复制出来封装到headers内; 另一个是自动处理cookie,引入模块requests的session,这个方法和requests一样可 阅读全文
posted @ 2020-04-01 20:56 GroundControl_852 阅读(1165) 评论(0) 推荐(1) 编辑

2020年3月31日

摘要: import requests from lxml import etree url= "https://tieba.baidu.com/p/6585139804" headers={"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) Ap 阅读全文
posted @ 2020-03-31 20:57 GroundControl_852 阅读(445) 评论(0) 推荐(0) 编辑