Python:requests库、BeautifulSoup4库的基本使用(实现简单的网络爬虫) 一、requests库的基本使用 requests是python语言编写的简单易用的HTTP库,使用起来比urllib更加简洁方便。 requests是第三方库,使用前需要通过pip安装。 pip in ...
分类:
编程语言 时间:
2019-11-10 19:44:47
阅读次数:
98
安装 pip install requests 测试接口 http://httpbin.org/get get请求 响应对象 = requests.get(......) ? **参数:** ? url: ? headers = {} ? cookies = {} ? params = {} ? p ...
分类:
其他好文 时间:
2019-11-10 19:38:40
阅读次数:
116
requets requests是python实现的简单易用的HTTP库,使用起来比urllib简洁很多 因为是第三方库,所以使用前需要cmd安装 pip install requests 安装完成后import一下,正常则说明可以开始使用了。 基本用法: requests.get()用于请求目标网 ...
分类:
编程语言 时间:
2019-11-10 19:13:14
阅读次数:
97
Windows 环境搭建 1. 下载安装pip install httprunner==1.4.2hrun -V #1.4.2har2case -V #0.1.82. httprunnermanager项目地址https://github.com/HttpRunner/HttpRunnerManag ...
分类:
Web程序 时间:
2019-11-10 14:01:22
阅读次数:
105
在pycharm中更新pip无效,需要先卸载pip,之后去下载pip离线包,手动安装。 1.卸载pip pip uninstall pip 2.去官网下载pip安装包 3.安装pip easy_install pip 取消Pycharm双击shift弹出来的搜索框 1、按ctrl+shift+a,弹 ...
分类:
其他好文 时间:
2019-11-09 14:08:50
阅读次数:
109
imposm安装 pip install imposm 报错,参考:https://imposm.org/docs/imposm/2.5.0/install.html 并安装依赖: sudo ap-get install build-essential python-dev protobuf-com ...
分类:
其他好文 时间:
2019-11-08 20:59:45
阅读次数:
117
虚拟环境 一简介 一般一个项目一个环境,因为可能用到的包的版本不兼容,因此虚拟环境很有必要。 一是anaconda的虚拟环境 二是用virtualwrapper,用pip直接安装即可使用 pip install virtualenvwrapper-win linux下安装pip install vi ...
分类:
其他好文 时间:
2019-11-07 13:30:04
阅读次数:
92
1. pymong python操作mongodb需要利用Python的第三方库,pymong pip安装: pip install pymongo 2. 连接方式 from pymongo import MongoClient conn = MongoClient() #可传参数:地址、端口 _d ...
分类:
数据库 时间:
2019-11-04 11:25:30
阅读次数:
74
1.wxpy库介绍 wxpy 在 itchat 的基础上,通过大量接口优化提升了模块的易用性,并进行丰富的功能扩展。 文档地址:https://wxpy.readthedocs.io 从 PYPI 官方源下载安装 pip install -U wxpy 2.图灵机器人 首先注册一个账号:http:/ ...
分类:
微信 时间:
2019-11-04 00:17:06
阅读次数:
148
安装 pip install scrapy 建立一个爬虫项目 scrapy startproject 项目名称 scrapy startproject itcast 生成一个爬虫 scrapy genspider 爬虫名称 "爬虫范围" scrapy genspider itcast "itcast ...
分类:
其他好文 时间:
2019-11-02 19:54:48
阅读次数:
84