Merge remote-tracking branch 'origin/master'

This commit is contained in:
Mikkel Milo 2019-04-06 17:41:08 +02:00
commit 7ba556bc29
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']:
sum += lel['vehicleCount']
len += 1
if sum > 0:
curr_avg = len / sum
else:
curr_avg = 0
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")