马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
import urllib.request as request
import requests
proxies = {
'https': 'https://127.0.0.1',
'http': 'http://127.0.0.1'
}
headers = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'
}
print('--------------使用urllib--------------')
google_url = 'http://httpbin.org/get'
opener = request.build_opener(request.ProxyHandler(proxies))
request.install_opener(opener)
req = request.Request(google_url, headers=headers)
response = request.urlopen(req)
print(response.read().decode())
)
运行提示:urllib.error.URLError: <urlopen error [WinError 10061] 由于目标计算机积极拒绝,无法连接。>
使用了‘Tunnelo VPN’代理插件后,验证代理ip,需要在‘proxies = { 'https': 'https://127.0.0.1', 'http': 'http://127.0.0.1'}’中为IP:127.0.0.1添加具体的端口号,可是在插件中没看到端口号?
Vpn代理的地址为: 54.36.113.3,本机'ipconfig'命令显示的IP为‘192.168.2.101’,在网页中查看实际的IP为'183.206.4.241',那'127.0.0.1'的端口号应为多少?(或告诉我怎么查找,花了一个晚上查资料,找不到结果 )
下面是‘arp-an’显示的内容(端口内容较多,
协议 本地地址 外部地址 状态
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1536 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1537 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1538 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1539 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1550 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1557 0.0.0.0:0 LISTENING
TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING
TCP 0.0.0.0:5357 0.0.0.0:0 LISTENING
TCP 0.0.0.0:7680 0.0.0.0:0 LISTENING
TCP 127.0.0.1:1001 0.0.0.0:0 LISTENING
TCP 127.0.0.1:4012 0.0.0.0:0 LISTENING
TCP 127.0.0.1:4013 0.0.0.0:0 LISTENING
TCP 127.0.0.1:6379 0.0.0.0:0 LISTENING
TCP 127.0.0.1:6942 0.0.0.0:0 LISTENING
TCP 127.0.0.1:7162 0.0.0.0:0 LISTENING
TCP 127.0.0.1:7496 127.0.0.1:7497 ESTABLISHED
TCP 127.0.0.1:7497 127.0.0.1:7496 ESTABLISHED
TCP 127.0.0.1:7498 127.0.0.1:7499 ESTABLISHED
TCP 127.0.0.1:7499 127.0.0.1:7498 ESTABLISHED
TCP 127.0.0.1:23403 0.0.0.0:0 LISTENING
TCP 127.0.0.1:44440 0.0.0.0:0 LISTENING
TCP 127.0.0.1:63342 0.0.0.0:0 LISTENING
TCP 192.168.2.101:139 0.0.0.0:0 LISTENING
TCP 192.168.2.101:7142 52.230.83.250:443 ESTABLISHED
TCP 192.168.2.101:7189 108.177.97.188:5228 ESTABLISHED
TCP 192.168.2.101:7863 23.219.132.43:80 ESTABLISHED
TCP 192.168.2.101:7865 54.36.113.3:443 TIME_WAIT
TCP 192.168.2.101:7866 54.36.113.3:443 ESTABLISHED
TCP 192.168.2.101:7867 54.36.113.3:443 TIME_WAIT
TCP 192.168.2.101:7868 10.0.0.2:1688 SYN_SENT
TCP 192.168.2.101:7869 111.221.29.253:443 TIME_WAIT
TCP 192.168.2.101:7870 52.175.27.38:443 ESTABLISHED
TCP [::]:135 [::]:0 LISTENING
TCP [::]:445 [::]:0 LISTENING
TCP [::]:1536 [::]:0 LISTENING
TCP [::]:1537 [::]:0 LISTENING
TCP [::]:1538 [::]:0 LISTENING
TCP [::]:1539 [::]:0 LISTENING
TCP [::]:1550 [::]:0 LISTENING
TCP [::]:1557 [::]:0 LISTENING
TCP [::]:3306 [::]:0 LISTENING
TCP [::]:5357 [::]:0 LISTENING
TCP [::]:7680 [::]:0 LISTENING
UDP 0.0.0.0:123 *:*
UDP 0.0.0.0:500 *:*
UDP 0.0.0.0:3702 *:*
UDP 0.0.0.0:3702 *:*
UDP 0.0.0.0:3702 *:*
UDP 0.0.0.0:3702 *:*
UDP 0.0.0.0:3702 *:*
UDP 0.0.0.0:3702 *:*
UDP 0.0.0.0:4500 *:*
UDP 0.0.0.0:5050 *:*
UDP 0.0.0.0:5353 *:*
UDP 0.0.0.0:5353 *:*
UDP 0.0.0.0:5353 *:*
UDP 0.0.0.0:5355 *:*
UDP 0.0.0.0:50841 *:*
UDP 0.0.0.0:55020 *:*
UDP 0.0.0.0:56915 *:*
UDP 0.0.0.0:58358 *:*
UDP 0.0.0.0:58359 *:*
UDP 127.0.0.1:1900 *:*
UDP 127.0.0.1:48400 *:*
UDP 127.0.0.1:48401 *:*
UDP 127.0.0.1:49664 *:*
UDP 127.0.0.1:51306 *:*
UDP 192.168.2.101:137 *:*
UDP 192.168.2.101:138 *:*
UDP 192.168.2.101:1900 *:*
UDP 192.168.2.101:2177 *:*
UDP 192.168.2.101:51305 *:*
UDP [::]:123 *:*
UDP [::]:500 *:*
UDP [::]:3702 *:*
UDP [::]:3702 *:*
UDP [::]:3702 *:*
UDP [::]:3702 *:*
UDP [::]:3702 *:*
UDP [::]:3702 *:*
UDP [::]:4500 *:*
UDP [::]:5353 *:*
UDP [::]:5353 *:*
UDP [::]:5355 *:*
UDP [::]:50842 *:*
UDP [::]:55021 *:*
UDP [::]:56916 *:*
UDP [::]:58359 *:*
UDP [::1]:1900 *:*
UDP [::1]:51304 *:*
UDP [fe80::345d:d8fe:bf08:92ce%6]:1900 *:*
UDP [fe80::345d:d8fe:bf08:92ce%6]:2177 *:*
UDP [fe80::345d:d8fe:bf08:92ce%6]:51303 *:*
我用的代理url = 'http://www.xicidaili.com/nn/'
|