Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@audy
Created January 22, 2018 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save audy/6de59eb1874b486a0d4e66e099c1af92 to your computer and use it in GitHub Desktop.
Save audy/6de59eb1874b486a0d4e66e099c1af92 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import requests
from bs4 import BeautifulSoup
url = 'http://www.berkeleybowl.com/daily-hot-soup'
res = requests.get(url)
soup = BeautifulSoup(res.content, 'html5lib')
locations = soup.find_all('div', class_='block-inner')[3:5]
for location in locations:
name = location.find(class_='block-title').text
print(name)
print('='*len(name))
timestamp = location.find_all(class_='field-item')[0].text
print('* {} *\n'.format(timestamp))
soups = [ n.text for n in location.find_all(class_='field-item')[1:] ]
for n, soup in enumerate(soups):
print('{}.) {}'.format(n, soup))
print('\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment