In the "Games" filter, 27_3draw was showing up as 273draw with the 3 underlined....
[fpdb-dooglus.git] / pyfpdb / P5sResultsParser.py
blob9cbd579c2e6fcc0b050830126cbbbcda0317e2a6
1 # -*- coding: utf-8 -*-
2 import urllib2, re
3 import pprint
4 from BeautifulSoup import BeautifulSoup
7 playername = ''
9 if playername == '':
10 print _("You need to manually enter the playername")
11 exit(0)
13 page = urllib2.urlopen("http://www.pocketfives.com/poker-scores/%s/" %playername)
14 soup = BeautifulSoup(page)
16 results = []
18 for table in soup.findAll('table'):
19 # print "Found %s" % table
20 for row in table.findAll('tr'):
21 tmp = []
22 for col in row.findAll('td'):
23 tmp = tmp + [col.string]
24 #print col.string
25 if len(tmp) > 3 and tmp[2] <> None:
26 results = results + [tmp]
28 cols = ['TOURNAMENT', 'SITE', 'DATE', 'PRIZEPOOL', 'BUY-IN', 'PLACE', 'WON']
30 pp = pprint.PrettyPrinter(indent=4)
32 for result in results:
33 print "Site: %s Date: %s\tPrizepool: %s\tBuyin: %s\tPosition: %s\tWon: %s" %(result[2], result[3], result[4], result[5], result[6], result[7])