debug('fetching',url)
dataf = urllib2.urlopen(url)
debug('fetched',dataf)
- soup = BeautifulSoup(dataf,
- convertEntities=BeautifulSoup.HTML_ENTITIES)
+ soup = BeautifulSoup(dataf)
title_arch_re = regexp.compile('(\\S.*\\S) Archipelago \\((\\S+)\\)$')
def parse_chart():
ta = soup.find('textarea')
debug('ta',ta)
- rc = ta.renderContents()
- debug('rc',rc)
- return rc
+ s = ta.string
+ debug('s',s)
+ s = regexp.sub(r'\<\;', '<', s)
+ s = regexp.sub(r'\>\;', '>', s)
+ s = regexp.sub(r'\"\;', '"', s)
+ s = regexp.sub(r'\&\;', '&', s)
+ debug('s',s)
+ return s
def parse_ocean():
- firstarch = soup.find('a', attrs = {'title': title_arch_ok})
- debug('fa',firstarch)
+ content = soup.find('div', attrs = {'id': 'content'})
def findall_title_arch_ok(t):
return t.findAll('a', attrs = {'title': title_arch_ok})
if u.name != 'table': return False
return len(findall_title_arch_ok(u)) > 1
- archestable = firstarch.findParent('table', attrs={'border':'1'})
+ archestable = content.findChild('table', attrs={'border':'1'})
debug('at',archestable)
archsoups = []