Fixing bugs

This commit is contained in:
Alexander Munch-Hansen 2019-04-06 17:38:19 +02:00
parent c3be26fa51
commit 36c980d94f
2 changed files with 15 additions and 1 deletions

View file

@ -19,7 +19,10 @@ def cars_in_traffic(context: Context) -> Prediction:
for lel in data['result']['records']: for lel in data['result']['records']:
sum += lel['vehicleCount'] sum += lel['vehicleCount']
len += 1 len += 1
curr_avg = len / sum if sum > 0:
curr_avg = len / sum
else:
curr_avg = 0
diff = day_avr - night_avr diff = day_avr - night_avr

View file

@ -0,0 +1,11 @@
import requests
from bs4 import BeautifulSoup
def is_restaurant_open(name):
r = requests.get("https://www.just-eat.dk/area/8000-%C3%A5rhusc")
soup = BeautifulSoup(r.content, features='html5lib')
print(soup.find('div', {'data-test-id': 'listingGroupOpen'}))
is_restaurant_open("stop2shop")