python利用urllib访问url

180it 2022-07-28 PM 1184℃ 0条
import urllib.request
import ssl

context = ssl._create_unverified_context()
# url = 'https://baike.baidu.com/item/vivo'
url ="https://baike.baidu.com/item/vivo"
request = urllib.request.Request(url)
response = urllib.request.urlopen(url=request,context=context)
print (response.read().decode('utf-8'))
支付宝打赏支付宝打赏 微信打赏微信打赏

如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!

标签: none

python利用urllib访问url