forked from neilkod/oow-vote-hacking
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
given an url, retrieve name and ids of all voters
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/python | ||
|
||
# huge work-in-progress | ||
# given an abstract page, retrieve the names and ids of all of the voters | ||
|
||
import re | ||
import urllib2 | ||
from BeautifulSoup import BeautifulSoup | ||
url = 'https://mix.oracle.com/events/oow11/proposals/10916-oracle-11gr2-cluster-upgrade-success-story-a-complete-life-cycle' | ||
page = urllib2.urlopen(url) | ||
soup = BeautifulSoup(page) | ||
|
||
|
||
voters = soup.findAll('a',{"href":re.compile('/events/oow11/voting/view/'),"title":True}) | ||
|
||
for voter in voters: | ||
name = voter.get('title').lower() | ||
id = re.findall(r'\d{3,}',voter.get('href'))[0] | ||
print name, id |