Python
binbincoder
生而无畏、战至终章
展开
-
Python requests包get响应内容中文乱码解决方案
Requests源码包解析原理分析requests的源代码发现,text返回的是处理过的Unicode型的数据,而使用content返回的是bytes型的原始数据。也就是说,r.content相对于r.text来说节省了计算资源,content是把内容bytes返回. 而text是decode成Unicode. 如果headers没有...转载 2020-07-24 16:48:47 · 3002 阅读 · 1 评论 -
Centos7.5.64 python2.7升级python3.7
安装步骤:https://techglimpse.com/install-python-openssl-support-tutorial/安装启发:https://stackoverflow.com/questions/52566503/python-3-7-cant-connect-to-https-url-because-the-sslmodule-is-not-available原创 2020-06-11 16:32:41 · 138 阅读 · 0 评论 -
bd爬虫总结
爬虫心得:首先要有页面的真是路径,不然就算你的代码很强,那也爬不到任何东西。URL1:关键词1href="/s?ie=utf-8&cl=2&medium=0&rtt=1&bsst=1&rsv_dl=news_b_pn&tn=news&word=%E7%99%BE%E5%BA%A6&rsv_sug3=5&rsv_sug4=...原创 2019-07-03 15:32:21 · 632 阅读 · 0 评论 -
python读取指定文件中的字符串报错问题
错误汇总: 1.json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1) 2.AttributeError: 'str' object has no attribute 'read' 3.UnicodeDecodeError: 'gbk' ...原创 2019-10-14 19:05:38 · 374 阅读 · 0 评论 -
对于PIL中打开图片时出现警告导致pytesseract识别图片验证码时报错
本文链接:https://blog.csdn.net/sinat_32404247/article/details/79627101 ...转载 2019-08-20 18:56:46 · 287 阅读 · 0 评论 -
Python Scrapy框架第一弹
初次接触Scrapy框架先来点干货一、创建scrapy项目 ``` 1、Windows安装Scrapy略 2、在指定目录使用命令创建爬虫项目 scrapy startproject myfirstScrapy 3、Scrapy项目结构 运行上述代码的目的是创建相应的项目文件,如下所示: 放置 spider 代码的目录文件 spiders(用于编写爬虫) 项目中的 ite...原创 2019-10-10 21:33:22 · 115 阅读 · 0 评论