Created
July 2, 2016 06:55
-
-
Save christopherkullenberg/81d1e9f5b840cbf44cfb6940283bc9fc to your computer and use it in GitHub Desktop.
Parse html of almedalsveckan.info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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