请大家帮我看一下,为什么明明已经decode()了,为什么打印出来还是之前的状态
import urllib.requestimport re
url = "https://tieba.baidu.com/p/4192700628"
def open_url(url):
req = urllib.request.Request(url)
req.add_header = ('User-Agent','Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36')
response = urllib.request.urlopen(req)
html = response.read().decode('utf-8')
return html
print(open_url(url))
你是想要什么状态? 这个不是正常打印了嘛 建议使用requests Twilight6 发表于 2020-7-20 19:57
你是想要什么状态? 这个不是正常打印了嘛
现在正在学这则表达,我想知道返回的网页和审核元素里的elements是不是一致的,有的时候我觉得好像某些部分对不上,某些部分对的上。
页:
[1]