Answer the question
In order to leave comments, you need to log in
Why is BeautifulSoup not working properly on Heroku server?
I am making a Telegram bot that should parse sporting events. There is this request:
today = str(datetime.today()).split()[0]
url = 'https://www.championat.com/stat/football/#' + today
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'}
r = requests.get(url, headers=headers)
html = BeautifulSoup(r.text, 'html.parser')
[s.extract() for s in html('script')]
tournaments = html.findAll("div", {"class": "seo-results__tournament"})
matches = html.find("div", {"class": "seo-results"}).findAll("ul")
.find
always returns None
. How can this be fixed?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question