摘要: import requests from bs4 import BeautifulSoup import re url = 'https://www.ipip.net/ip.html' while True: ip = input('输入你要查询的IP:') data = {'ip': ip} header = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6. 阅读全文
posted @ 2019-08-27 13:35 xiangwb 阅读(2316) 评论(1) 推荐(0) 编辑
摘要: 首先去官网下载Python最新版本,本次下载为Python3.7.3 将下载好的压缩文件进行解压 配置编译,因为上面依赖包是用yum安装而不是自己编译的,所以都是安装在系统默认目录下,因此各种选项不用加默认即可生效: 补充一下:这里加上--enable-shared和-fPIC之后可以将python 阅读全文
posted @ 2019-05-16 17:55 xiangwb 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 1.安装pyinstaller,官网:http://www.pyinstaller.org/downloads.html cmd中进入python的pip文件的所在目录执行命令 2.cmd中执行命令 步骤2的目录中会多出几个文件夹,exe程序在dist文件下,可双击直接运行。 常用参数说明: –ic 阅读全文
posted @ 2019-05-14 00:58 xiangwb 阅读(255) 评论(0) 推荐(0) 编辑
摘要: import time import requests from bs4 import BeautifulSoup def loop(): while True: sission = requests.Session() r1 = sission.get('http://xwb2.w113.idchz.com/index.php/archives/25... 阅读全文
posted @ 2019-05-14 00:47 xiangwb 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 最近在使用python进行爬虫时,抓取的数据格式是ASCII编码,网页源码数据是 “\u6697\u88d4\u5251\u9b54” 由于在python中”\”代表转义字符,所以在 python 中会显示这样: “\u6697\u88d4\u5251\u9b54” 如何将其转为中文呢? 阅读全文
posted @ 2019-05-12 20:48 xiangwb 阅读(7586) 评论(2) 推荐(1) 编辑