Created
December 1, 2010 17:50
-
-
Save k0001/723895 to your computer and use it in GitHub Desktop.
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
# NOTE: I have no reason for indenting this like I do. | |
# But writing scrappers can get boring sometimes, you know. | |
# -^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^ | |
foo = un(first_or_value(tr.select('//*[preceding-sibling::font/a[contains(., "Bajar")]]'))) | |
# -^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^ | |
if 'nominal' in foo: l.add_value('tipo', 'nominal') | |
elif 'numerica' in foo: l.add_value('tipo', 'numerica') | |
else : raise ValueError(u'Not "nominal" nor "numerica" in %s' % foo) | |
# -^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^ | |
if 'negativa' in foo: l.add_value('resultado', 'negativa') | |
elif 'afirmatva' in foo: l.add_value('resultado', 'afirmativa') | |
else : raise ValueError(u'Not "afirmativa" nor "negativa" in %s' % foo) | |
# -^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment