From: W. Trevor King Date: Sat, 16 Feb 2013 02:29:20 +0000 (-0500) Subject: scrape.nasdaq: Strip whitespace from scraped values X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;ds=sidebyside;p=insider.git scrape.nasdaq: Strip whitespace from scraped values For example, I was getting '\nDIR\n' as a relation code. --- diff --git a/insider/scrape/nasdaq.py b/insider/scrape/nasdaq.py index 4ee45af..9e908d6 100644 --- a/insider/scrape/nasdaq.py +++ b/insider/scrape/nasdaq.py @@ -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