Closed TangGrit closed 6 years ago
import requests from bs4 import BeautifulSoup
def getHTMLText(url): try: r = requests.get(url,timeout=30) r.raise_for_status() r.encoding = 'gb2312' return r.text except: retun r.raise_for_status() def main(): url = 'http://www.okooo.com/soccer/match/156622/odds/change/14/' html = getHTMLText(url) main()
import requests from bs4 import BeautifulSoup
def getHTMLText(url): try: r = requests.get(url,timeout=30) r.raise_for_status() r.encoding = 'gb2312' return r.text except: retun r.raise_for_status() def main(): url = 'http://www.okooo.com/soccer/match/156622/odds/change/14/' html = getHTMLText(url) main()