标签:def com port https code encoding int 技术 png
import requests from bs4 import BeautifulSoup def getHTMLText(url): try: r=requests.get(url,timeout=30) soup=BeautifulSoup(r.text) r.raise_for_status() r.encoding=‘utf-8‘ return r.text,r.status_code,len(r.text),r.encoding,len(soup.text) except: return "" url="https://www.baidu.com/" for i in range(20): print(i) print(getHTMLText(url))
标签:def com port https code encoding int 技术 png
原文地址:https://www.cnblogs.com/MARCOREUS11/p/12883014.html