import requests def getHTMLText(url): try: r=requests.get(url,timeout=30) r.raise_for_status() r.encoding='utf-8' return r.text except: return "" url="https://123.sogou.com" print(getHTMLText(url))
import requests def getHTMLText(url): try: r=requests.get(url,timeout=30) r.raise_for_status() r.encoding='utf-8' return r.text except: return "" url="https://123.sogou.com" print(getHTMLText(url))