In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
Code examples
#-*-coding:utf-8-*-import requestsheader = {'User-Agent':' Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36'} proxy_ip = {'https':' https://115.28.148.137:8118'}html = requests.get ("http://www.baidu.com", headers=header, proxies=proxy_ip) print htmlprint html.text
Second, you can change the proxy IP by modifying the address of the proxy IP server of the proxy_ip parameter.
Third, error warning
Requests.exceptions.ProxyError: HTTPSConnectionPool (host='www.baidu.com', port=443): Max retries exceeded with url: / (Caused by ProxyError ('Cannot connect to proxy.', error (10054,'))
There are generally two reasons for errors:
1. The ip proxy server cannot be used properly.
2. The protocol used by the IP agent is abnormal, for example, http:// and https:// cannot be written wrong.
If it is a http proxy server, it is written as follows:
Proxy_ip = {'http':' http://115.28.148.137:8118'}
If it is a https proxy server, it is written as follows:
Proxy_ip = {'https':' https://115.28.148.137:8118'}
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.