scrape.nasdaq: Strip whitespace from scraped values master
authorW. Trevor King <wking@tremily.us>
Sat, 16 Feb 2013 02:29:20 +0000 (21:29 -0500)
committerW. Trevor King <wking@tremily.us>
Sat, 16 Feb 2013 02:29:20 +0000 (21:29 -0500)
For example, I was getting '\nDIR\n' as a relation code.

insider/scrape/nasdaq.py

index 4ee45afcc20a36e88a296885c2b3ce9528c12291..9e908d6bd3412d591698be1da6226a8789c5257d 100644 (file)
@@ -83,7 +83,7 @@ def get_trades(ticker):
                 LOG.debug('wrong class ({}, expected {})'.format(
                         classes, class_))
                 break  # wrong class
-            value = tds[i].text
+            value = tds[i].text.strip()
             if class_ == 'Holdnum':  # decode numerical values
                 if value == '-':
                     value = None