标签:ext bsp requests timeout text 获取 class lxml style
1 def getTitle(self,url): 2 #get title 3 title = ‘time out‘ 4 try: 5 self.res = requests.get(url,timeout=5) 6 7 8 soup = BeautifulSoup(self.res.text, ‘lxml‘) 9 10 title = soup.title.text 11 12 except Exception: 13 title = self.res.text 14 15 return title
标签:ext bsp requests timeout text 获取 class lxml style
原文地址:https://www.cnblogs.com/xiaobaichuangtianxia/p/9772844.html