python 爬虫求助
https://www.juliangip.com/agent可以检测ip,
我做了个爬虫,
from urllib.request import *
from urllib.parse import *
url = 'https://www.juliangip.com/checkAgent'
data = {}
data['type']: 'http'
data['ipPort']: '47.105.91.226:8118'
head = {}
head['user-agent'] = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.39 Safari/537.36 Edg/104.0.1293.21'
data = urlencode(data).encode('utf-8')
req = Request(url,data,head)
xx = urlopen(req)
html = xx.read().decode('utf-8')
print(html)
求助? python爱好者. 发表于 2022-7-18 17:57
求助?
没报错 rom urllib.request import *
from urllib.parse import *
url = 'https://www.juliangip.com/checkAgent'
data = {}
data['type'] = 'http'
data['ipPort'] = '47.105.91.226:8118'
head = {}
head['user-agent'] = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.39 Safari/537.36 Edg/104.0.1293.21'
data = urlencode(data).encode('utf-8')
req = Request(url,data,head)
xx = urlopen(req)
html = xx.read().decode('utf-8')
print(html) 临时号 发表于 2022-7-18 19:34
问问有什么不用吗 shiyouroc 发表于 2022-7-18 19:57
问问有什么不用吗
data['type']: 'http'
data['ipPort']: '47.105.91.226:8118'
改成= 临时号 发表于 2022-7-18 19:58
data['type']: 'http'
data['ipPort']: '47.105.91.226:8118'
改成=
哦 临时号 发表于 2022-7-18 19:58
data['type']: 'http'
data['ipPort']: '47.105.91.226:8118'
改成=
明天我试试试
页:
[1]