Skip to content

Commit 6cc06b8

Browse files
committed
proxy add htpps
1 parent 4257caf commit 6cc06b8

File tree

2 files changed

+30
-23
lines changed

2 files changed

+30
-23
lines changed

.idea/workspace.xml

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
import requests
22
from bs4 import BeautifulSoup
33

4-
5-
proxies = {
6-
'http': '123.206.6.17:808'
7-
}
8-
r = requests.get("http://www.ip.cn/", proxies=proxies)
9-
soup = BeautifulSoup(r.text, 'lxml')
10-
print(r.text)
4+
# proxies = {
5+
# 'https': '123.206.6.17:443'
6+
# }
7+
# r = requests.get("http://www.ip.cn/", proxies=proxies)
8+
# soup = BeautifulSoup(r.text, 'lxml')
9+
# print(r.text)
1110

1211

1312
# 代理池 http://7xrnwq.com1.z0.glb.clouddn.com/proxy_list.txt
1413
# 代理池 http://api.xicidaili.com/free2016.txt
1514

1615
# request = requests.get('http://7xrnwq.com1.z0.glb.clouddn.com/proxy_list.txt')
1716
# print(request.text)
17+
18+
19+
ss = requests.session()
20+
21+
ss.proxies = {'http': 'http://123.206.6.17:3128', 'https': 'http://123.206.6.17:3128'}
22+
23+
print(ss.get('http://www.qq.com'))
24+
print(ss.get('https://www.github.com'))

0 commit comments

Comments
 (0)