from optparse import OptionParser
from BeautifulSoup import BeautifulSoup
+
+# For fuck's sake!
+import codecs
+import locale
+def fix_stdout():
+ sys.stdout = codecs.EncodedFile(sys.stdout, locale.getpreferredencoding())
+ def null_decode(input, errors='strict'):
+ return input, len(input)
+ sys.stdout.decode = null_decode
+# From
+# http://ewx.livejournal.com/457086.html?thread=3016574
+# http://ewx.livejournal.com/457086.html?thread=3016574
+# lightly modified.
+# See also Debian #415968.
+fix_stdout()
+
+
ocean = None
soup = None
opts = None
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 = []