Skip to content

Commit 4257caf

Browse files
committed
proxy
1 parent 93bd618 commit 4257caf

File tree

2 files changed

+40
-35
lines changed

2 files changed

+40
-35
lines changed

.idea/workspace.xml

Lines changed: 34 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python基础代码/技巧-使用代理请求网页.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import requests
2+
from bs4 import BeautifulSoup
3+
24

35
proxies = {
4-
'http': '123.206.6.17:99'
6+
'http': '123.206.6.17:808'
57
}
6-
r = requests.get("https://httpbin.org/ip", proxies=proxies)
7-
html = r.text
8-
print(html)
8+
r = requests.get("http://www.ip.cn/", proxies=proxies)
9+
soup = BeautifulSoup(r.text, 'lxml')
10+
print(r.text)
911

1012

1113
# 代理池 http://7xrnwq.com1.z0.glb.clouddn.com/proxy_list.txt

0 commit comments

Comments
 (0)