通过python获取到网页:
这里是获取的百度
import urllib.request #导入包
response = urllib.request.urlopen("https://www.baidu.com") #设置目标链接
html = response.read() #将得到的目标网页读取出来
html = html.decode("utf-8") 通过转码,以正常格式显示出来
print(html)
通过python获取到网页:
这里是获取的百度
import urllib.request #导入包
response = urllib.request.urlopen("https://www.baidu.com") #设置目标链接
html = response.read() #将得到的目标网页读取出来
html = html.decode("utf-8") 通过转码,以正常格式显示出来
print(html)