![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
xpisme
好好学习
展开
-
windows 下 pip 安装包 报错
error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27答案很明显 去 http://aka.ms/vcpython27 下载 Microsoft Visual C++ Compiler for Python 2.7 即可原创 2016-12-01 11:58:04 · 524 阅读 · 0 评论 -
windows install lxml for scrapy
在安装scrapy过程中可能遇到 ********************************************************************************* Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed? ****************原创 2016-12-01 13:54:55 · 412 阅读 · 0 评论 -
Python 爬虫 ip防ban
其核心为就是通过代理ip去爬代码实现很简单import urlliburllib.urlopen('http://www.xxx.com', proxies={"http":'http://122.72.32.74:80'})log日志如下139.224.61.174 - - [24/Nov/2016:10:44:21 +0800] "GET / HTTP/1.0" 200 14 "-" "Py原创 2016-11-24 10:54:48 · 1101 阅读 · 0 评论 -
scrapy中解决中文乱码问题
场景一:输出到文件中spiders/test.pydef parse(self, response): response.css('title::text').extract()[0] # 重要1import jsonimport codecsclass TestPipeline(object): def open_spider(self, spider): self原创 2016-11-24 23:36:12 · 4731 阅读 · 0 评论 -
Scraping a JSON response with Scrapy
scrapy 爬到的response是一个json{ "code": "1", "data": "<div> <p class='one'> <a href='/people/yang' class='zg-link'>杨</a></p> <p class='two'> <a href='/people/wang' class='zg-link'>王</a></p> </di原创 2016-11-26 18:00:10 · 1435 阅读 · 0 评论 -
windows 上安装 pip 和 scrapy
scrapy 有版本限制 python2.7安装python python下载 下载之后点击安装即可 设置环境变量 将python.exe路径加入到PATH即可安装pip pip下载安装python get-pip.py安装scrapypython -m pip install scrapy原创 2016-12-01 11:44:21 · 1537 阅读 · 0 评论 -
Python 安装 MySQLdb
下载 MySQL-python-1.2.3.tar.gz解压tar xzvf MySQL-python-1.2.3.tar.gz查找mysql_config 并修改配置文件site.cfgcd MySQL-python-1.2.3whereis mysql_config 修改site.cfg 的mysql_config的路径是用最高权限执行python setup.py install原创 2016-11-22 14:29:15 · 658 阅读 · 0 评论