# HG changeset patch # User DaveM # Date 1520175795 0 # Node ID a0c217ee4168db1d9de4c1983ca67444160cb6ff # Parent b253748dbb11b2f413c85ce8c5d34dd75b171b08 current edits diff -r b253748dbb11 -r a0c217ee4168 V4/runme.py --- a/V4/runme.py Sun Mar 04 14:51:43 2018 +0000 +++ b/V4/runme.py Sun Mar 04 15:03:15 2018 +0000 @@ -14,7 +14,7 @@ # from lxml import html from bs4 import BeautifulSoup -def parsePage(horiscope, resp): +def parsePage(resp): horiscope = syn.planetPositions() soup = BeautifulSoup(resp.content, 'lxml') tcCell = soup.find_all('div', attrs={'class':'right-sedy-banner-svetlejsi'}) @@ -24,6 +24,7 @@ planetName = divList[i].getText().lower() if planetName in planetPositions.planetNames: horiscope.planets[planetName].setLocation(divList[i+2].getText(),divList[i+4].getText()) + return horiscope def makePeople(filename): stream = csv.DictReader(open(filename,'rb')) @@ -99,7 +100,7 @@ try: person.makePayload() resp = requestURL(person.url,person.payload) - parsePage(person.horiscope,resp) + person.horiscope = parsePage(resp) pdb.set_trace() parseTries = 0 except: