来个大佬帮忙看看问题出在哪了???
import requests
def getHTMLText():
try:
r=requests.get(url,time=20)
r.raise_for_status()
r.encoding='utf-8'
return r.text
except:
return""
url="http://www.baidu.com"
print(getHTMLText(url))
import requests
def getHTMLText():
try:
r=requests.get(url,time=20)
r.raise_for_status()
r.encoding='utf-8'
return r.text
except:
return""
url="http://www.baidu.com"
print(getHTMLText(url))
2019-06-10
举报