changeset 14:a0c217ee4168

current edits
author DaveM
date Sun, 04 Mar 2018 15:03:15 +0000
parents b253748dbb11
children 50a95089414d
files V4/runme.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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: