From: Ian Jackson Date: Tue, 1 Sep 2009 15:57:51 +0000 (+0100) Subject: More robust way to find arch/islands table X-Git-Tag: 3.4~35 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.web-live.git;a=commitdiff_plain;h=714a62245610bd19b4056878b808f3d6e59e88c6;hp=170049a6777baa9d15678e0f13804157bf6c02b0 More robust way to find arch/islands table --- diff --git a/yarrg/yppedia-ocean-scraper b/yarrg/yppedia-ocean-scraper index ad35c4d..a854035 100755 --- a/yarrg/yppedia-ocean-scraper +++ b/yarrg/yppedia-ocean-scraper @@ -95,8 +95,7 @@ def parse_chart(): 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}) @@ -105,7 +104,7 @@ def parse_ocean(): 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 = []