diff options
author | ssstvinc2 <sstvinc2@gmail.com> | 2017-03-24 19:05:54 -0400 |
---|---|---|
committer | ssstvinc2 <sstvinc2@gmail.com> | 2017-03-24 19:05:54 -0400 |
commit | ef0dc339f42c6befd07f0d626c1eaed8ad7ee057 (patch) | |
tree | a092ef149443a082f4db4d56bc972a48d7cc4f56 /unbiasedFunctions.py | |
parent | 79b293fdc9da9abe9399c727e08efb1b32fd4337 (diff) |
Added ABC News, some parser fixes as well
Diffstat (limited to 'unbiasedFunctions.py')
-rw-r--r-- | unbiasedFunctions.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/unbiasedFunctions.py b/unbiasedFunctions.py index fca2f2d..1a80d7a 100644 --- a/unbiasedFunctions.py +++ b/unbiasedFunctions.py @@ -41,7 +41,10 @@ def buildArticle(url, sourceName, encoding=None):#, titleDelStart, titleDelEnd, img=img.split('src="', 1)[1].split('"')[0]
else:
- img=content.split('og:image" content=')[1][1:].split('>')[0]
+ if 'og:image' in content:
+ img=content.split('og:image" content=')[1][1:].split('>')[0]
+ elif sourceName=='ABC News':
+ img='https://c1.staticflickr.com/7/6042/6276688407_12900948a2_b.jpgX'
if img[-1]=='/':
#because the quote separator could be ' or ",
#trim to just before it then lop it off
|