Skip to content

Instantly share code, notes, and snippets.

@christopherkullenberg
Created July 2, 2016 06:55
Show Gist options
  • Save christopherkullenberg/81d1e9f5b840cbf44cfb6940283bc9fc to your computer and use it in GitHub Desktop.
Save christopherkullenberg/81d1e9f5b840cbf44cfb6940283bc9fc to your computer and use it in GitHub Desktop.
Parse html of almedalsveckan.info
import urllib.request
import re
from bs4 import BeautifulSoup
with urllib.request.urlopen('http://www.almedalsveckan.info/event/user-view/38029') as event:
html = event.read()
soup = BeautifulSoup(html, 'html.parser')
datadivs = soup.findAll("div", { "class" : "row clearfix" })
for d in datadivs:
leftdivs = d.findAll("div", { "class" : "leftcol" })
rightdivs = d.findAll("div", { "class" : "rightcol" })
for l in leftdivs:
for x in l:
print(x)
for r in rightdivs:
for x in r:
print(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment