
爬虫
小妖怪怪
~~~逍遥又自在~~~
展开
-
scrapy 创建新工程
找到你的scrapy文件处:输入scrapy startproject + 要创建的工程名称:原创 2020-06-30 14:06:34 · 157 阅读 · 0 评论 -
解决python爬虫时乱码的问题
在你需要的网站的前面加上view-source:例如:view-source:https://www.luogu.com.cn/problem/P1000打开,如下图,在开头几行找到charset,对应的字符,进行转换字符。详细请见我的上一篇《人生苦短 python爬虫 学习周期》。...原创 2020-06-19 10:56:49 · 331 阅读 · 0 评论 -
人生苦短 python爬虫 学习周期
爬虫必备包 – requestfrom urllib import request获取数据 def get_data(): url = ' ' #创建request对象url请求头 headers = { ' user-agent' : ' ' } req = request.Request(url, headers=headers) #传user-agent response = request.urlopen(req) if response.getcode().原创 2020-06-19 10:50:46 · 182 阅读 · 0 评论