From 0ac55bbafa02ad951c9f1708f1fbc7c8746d5fce Mon Sep 17 00:00:00 2001 From: ssstvinc2 Date: Thu, 30 Mar 2017 15:23:46 -0400 Subject: Changed CSM to their /USA page --- parser.py | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/parser.py b/parser.py index 93642d8..f69281b 100755 --- a/parser.py +++ b/parser.py @@ -307,16 +307,19 @@ def buildWashTimes(): def buildCSM(): - url='http://www.csmonitor.com' + url='http://www.csmonitor.com/USA' name='Christian Science Monitor' #DOWNLOAD HOMEPAGE CONTENT content=urlToContent(url) + + #this makes sure we don't get '/USA' in the URL twice + url=url.split('/USA')[0] #get main headline h1=content - h1=h1.split('ui-top-center', 1)[1] + h1=h1.split('block-0-0', 1)[1] h1=h1.split('')[1:] for x in h2: - x=x.split('')[1] + h2=h2.split('