Skip to content

Instantly share code, notes, and snippets.

@wojtekerbetowski
Last active March 14, 2017 21:44
Show Gist options
  • Save wojtekerbetowski/2c60ce73552eb9f2496f78b1ff0cc59b to your computer and use it in GitHub Desktop.
Save wojtekerbetowski/2c60ce73552eb9f2496f78b1ff0cc59b to your computer and use it in GitHub Desktop.
Load most common PyWaw speakers

Output on 14.03.2017

$ python pywaw.py 
Collecting beautifulsoup4
  Using cached beautifulsoup4-4.5.3-py3-none-any.whl
Collecting requests
  Using cached requests-2.13.0-py2.py3-none-any.whl
Installing collected packages: beautifulsoup4, requests
Successfully installed beautifulsoup4-4.5.3 requests-2.13.0
('Przemek Lewandowski', 10)
('Konrad Gawda', 7)
('Konrad Hałas', 6)
('Zbigniew Siciarz', 6)
('Łukasz Balcerzak', 5)
('Marek Stępniowski', 5)
('Tomasz Ducin', 4)
('Łukasz Rekucki', 4)
('Wojtek Erbetowski', 3)
('Szymon Teżewski', 3)
('Grzegorz Gwardys', 3)
('Piotr Maliński', 3)
('Ola Sitarska', 3)
('Jakub Kot', 3)
('Rafał Mirończyk', 2)
('Piotr Betkier', 2)
('Jacek Kołodziej', 2)
('Radek Czajka', 2)
('Kamil Szcześniak', 2)
('Baptiste Mispelon', 2)
from collections import Counter
import pip
pip.main([
'install',
'beautifulsoup4',
'requests',
])
import requests
from bs4 import BeautifulSoup
html = requests.get('http://pywaw.org/spotkania/').text
soup = BeautifulSoup(html, 'html.parser')
speakers = [li.a.text for li in soup.select('li[itemprop="subEvent"]')]
summary = Counter(speakers).most_common()[0:20]
for elem in summary:
print(elem)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment