变更
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import requests
|
||||
|
||||
|
||||
def get_HTML_Text():
|
||||
try:
|
||||
r = requests.get(url, timeout=30)
|
||||
r.raise_for_status()
|
||||
r.encoding = r.apparent_encoding
|
||||
return r.text
|
||||
except:
|
||||
print("异常")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
url = "https://www.jd.com/robots.txt"
|
||||
print(get_HTML_Text())
|
||||
Reference in New Issue
Block a user