上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 34 下一页
摘要: 爬取网址: 完整代码: import sys from urllib import request, parse import ssl ssl._create_default_https_context = ssl._create_unverified_context url = "https:// 阅读全文
posted @ 2018-06-04 17:30 阿谋 阅读(267) 评论(0) 推荐(0)
摘要: python3爬取Post页面时, 报以下错误 "POST data should be bytes or an iterable of bytes. It cannot be of type str." 解决方案: 需要在urlencode语句后加encode(encoding='UTF8') 阅读全文
posted @ 2018-06-04 17:21 阿谋 阅读(190) 评论(0) 推荐(0)
摘要: 错误描述: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777) 解决方法 Python 升级到 2.7.9 之后引入了一个新特性,当使用urllib.urlopen打开一个 ht 阅读全文
posted @ 2018-06-04 17:10 阿谋 阅读(1721) 评论(0) 推荐(0)
摘要: Get方式 GET请求一般用于我们向服务器获取数据,比如说,我们用百度搜索传智播客:https://www.baidu.com/s?wd=传智播客 浏览器的url会跳转成如图所示: https://www.baidu.com/s?wd=%E4%BC%A0%E6%99%BA%E6%92%AD%E5%A 阅读全文
posted @ 2018-06-04 01:31 阿谋 阅读(1239) 评论(0) 推荐(0)
摘要: python3 抓取贴吧页面 1 from urllib import request, parse 2 import sys 3 4 5 def loadPage(url, filename): 6 """ 7 作用: 根据url发送请求, 获取服务器相应文件 8 url: 需要爬取的url地址 阅读全文
posted @ 2018-06-04 00:47 阿谋 阅读(227) 评论(0) 推荐(0)
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 34 下一页