![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
yunblog
这个作者很懒,什么都没留下…
展开
-
python
以下的都是在Python3.X环境下的 使用 input 函数接收用户的输入,返回的是 str 字符串 最简单的打印 print(“hello,word!”) hello,word! 打印数字 a=5 b=6 print(a) print(a,b) print(a+b) 5 5 6 11 打印字符 使用逗号连接会有空格,使用+号连接没有空格 a=“hello,” b=“world!...原创 2019-04-18 17:36:26 · 84 阅读 · 0 评论 -
将scrapy爬虫改写为分布式爬虫redis-scrapy
1,进入settings.py # 以下是加入的内容 # 1.(必须加)。使用scrapy_redis.duperfilter.REPDupeFilter的去重组件,在redis数据库里做去重。 DUPEFILTER_CLASS = "scrapy_redis.dupefilter.RFPDupeFilter" # 2.(必须加)。使用了scrapy_redis的调度器,在redis里面分配请求。...原创 2019-09-07 17:48:10 · 168 阅读 · 0 评论 -
python学习目录
https://blog.csdn.net/Scrat_Kong/article/details/90257118转载 2019-09-07 17:55:53 · 175 阅读 · 0 评论 -
Python中操作mysql的pymysql模块详解
Python中操作mysql的pymysql模块详解原创 2019-09-09 11:23:47 · 142 阅读 · 0 评论 -
scrapy设置user_agent及代理ip
在 middlewares.py 中添加如下代码,即可添加user_agent及代理ip // middlewares.py class UserAgentMiddleware(object): USER_AGENTS = [ 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko...原创 2019-09-09 17:56:59 · 190 阅读 · 0 评论 -
scrapy将爬取到的数据存储到mysql中,使用pymysql
在 pipelines.py中添加如下代码 import pymysql class JianshuPipeline(object): def __init__(self): dbparams = { 'host':'127.0.0.1', 'port':3306, 'user':'root', ...原创 2019-09-09 18:12:55 · 456 阅读 · 0 评论