urllib3

pip报“Cannot connect to proxy”与“Failed to establish a new connection: [Errno 113] No route to host"案例

时光总嘲笑我的痴心妄想 提交于 2020-09-27 16:57:50
在一台新的Linux(CentOS 7.7)服务器上使用pip安装python包时遇到下面错误和告警,如下所示: # pip install pymssql WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError(' Cannot connect to proxy. ', NewConnectionError(' <pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f8f866f3860>: Failed to establish a new connection: [Errno 113] No route to host ',))' : /simple/pymssql/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError(' Cannot connect to proxy. ',

Python百度图片批量下载器的空间复核岗dskjfhe

生来就可爱ヽ(ⅴ<●) 提交于 2020-09-24 04:52:11
Python百度图片批量下载器 环境 Python 3.7.4 urllib3==1.25.10 re os 4 抓取页面 def crawlPages(self): pages = [] for i in range(0 , self.number): url = self.url + ('&pn=%d' % i * self.offset) request = urllib.request.Request(headers = self.headers, url = url) response = urllib.request.urlopen(request) page = response.read().decode('utf-8') pages.append(page) return pages 提取图片URL 利用re库提取图片的URL,观察获取的页面,选择正则表达式为self.pattern = re.compile(r'"hoverURL":"(.*?)", "pageNum"', re.S) def extractLinks(self, pages): linkList = [] for page in pages: links = re.findall(self.pattern, str(page)) for link in links: if link is

pytest文档46-关于https请求警告问题(InsecureRequestWarning: Unverified HTTPS request is being made)

放肆的年华 提交于 2020-08-18 12:05:11
前言 使用 pytest 执行 https 请求用例的时候,控制台会出现警告:InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. 当出现这个警告的时候,我们第一反应是加忽略警告:urllib3.disable_warnings(),然而并不管用。 问题描述 使用requests库发https请求,添加verify=False忽略证书 # test_https.py import requests import urllib3 urllib3.disable_warnings() def test_h(): ''' author: 上海-悠悠 QQ交流群:779429633 blog: https://www.cnblogs.com/yoyoketang :return: ''' url = "https://www.cnblogs.com/yoyoketang" s = requests.session() s.verify = False r = s.get(url) assert "上海-悠悠" in r.text 命令行使用pytest运行用例 D:\demo>pytest test_https

urllib,urllib2,urllib3和请求模块之间有什么区别?

安稳与你 提交于 2020-08-14 01:59:59
问题: In Python, what are the differences between the urllib , urllib2 , urllib3 and requests module? 在Python中, urllib , urllib2 , urllib3 和 requests 模块之间有什么区别? Why are there three? 为什么有三个? They seem to do the same thing... 他们似乎在做同样的事情... 解决方案: 参考一: https://stackoom.com/question/8Syo/urllib-urllib-urllib-和请求模块之间有什么区别 参考二: https://oldbug.net/q/8Syo/What-are-the-differences-between-the-urllib-urllib2-urllib3-and-requests-module 来源: oschina 链接: https://my.oschina.net/u/4428122/blog/4341448

GitHub:爬虫集合:微博、Twitter、玩加、知网、虎牙、斗鱼、B站、WeGame、猫眼、豆瓣、安居客、居理新房等

☆樱花仙子☆ 提交于 2020-08-13 07:02:59
hello,小伙伴们大家好,今天给大家推荐的开源项目是 : CxSpider ,这个开源整合了作者自己的采集过的所有产品,包括微博、Twitter、玩加、知网、虎牙、斗鱼、B站、WeGame、猫眼、豆瓣、安居客、居理新房感兴趣的小伙伴可以下载看看,应该可以给你提供一个可借鉴的思路。 Project 爬虫详情 1. Twitter用户信息爬虫(twitter.user_info) @author ChangXing @version 4.1 @create 2017.12.25 @revise 2020.06.08 使用第三方模块twitter-scraper采集Twitter用户信息;因为该模块采集的粉丝数和关注数可能存在偏差,因此再通过Selenium抓取Twitter用户信息,以更正该模块采集的数量。 采集信息:粉丝数和关注数为twitter-scraper采集并配合Selenium爬虫检查,其他字段为twitter-scraper采集。 应用配置:无需使用代理IP,需要使用Selenium 2. Twitter用户推文爬虫(twitter.user_tweet) @author ChangXing @version 4.0 @create 2017.12.30 @revise 2020.06.08 微博热搜榜实时爬虫(weibo.hot_ranking) @author

最新Pip镜像(2020年6月30日更新)

♀尐吖头ヾ 提交于 2020-08-11 20:28:40
问题: WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘NewConnectionError(’<pip._vendor.urllib3.connection.HTTPConnection object at 0x7fc7fed99400>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known’,)’: /pypi/web/simple/numpy/ 解决: pip install [安装包名] -i http://pypi.douban.com/simple --trusted-host pypi.douban.com 以上亲测,简单好用!!! 参考链接 来源: oschina 链接: https://my.oschina.net/u/4400968/blog/4330797

pip报“Cannot connect to proxy”与“Failed to establish a new connection: [Errno 113] No route to host"案例

*爱你&永不变心* 提交于 2020-08-11 17:39:21
在一台新的Linux(CentOS 7.7)服务器上使用pip安装python包时遇到下面错误和告警,如下所示: # pip install pymssql WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError(' Cannot connect to proxy. ', NewConnectionError(' <pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f8f866f3860>: Failed to establish a new connection: [Errno 113] No route to host ',))' : /simple/pymssql/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError(' Cannot connect to proxy. ',

pip报“Cannot connect to proxy”与“Failed to establish a new connection: [Errno 113] No route to host"案例

浪子不回头ぞ 提交于 2020-08-11 04:23:06
在一台新的Linux(CentOS 7.7)服务器上使用pip安装python包时遇到下面错误和告警,如下所示: # pip install pymssql WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError(' Cannot connect to proxy. ', NewConnectionError(' <pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f8f866f3860>: Failed to establish a new connection: [Errno 113] No route to host ',))' : /simple/pymssql/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError(' Cannot connect to proxy. ',

saltstack 实践

与世无争的帅哥 提交于 2020-08-10 10:12:05
salt 多master搭建及salt-api调用 环境: OS:CentOS6.7 Python3.6 + pip Saltstack 3001 Master: A c61 192.168.122.201 C c63 192.168.122.203 Slave: B c62 192.168.122.202 D c64 192.168.122.204 安装软件: pip install salt cherrypy 一、 salt多master实践 A/C: salt-master B/D: /etc/salt/minion master: - c61 - c63 id: 192.168.122.202 (B) id: 192.168.122.204 (D) 启动 salt-minion A/C: salt-key -A (接受B/D加入) 完成搭建 1.系统yum安装的saltstack 2015.5.11版本,搭建多master不成功 2.当前单master的minion节点,修改配置后,需要重启salt-minion服务,新master做好信任 二、 salt-api搭建 $ salt-call --local tls.create_self_signed_cert /etc/salt/master default_include: master.d/*.conf /etc