Skip to content

Commit

Permalink
fix agent name and advert address
Browse files Browse the repository at this point in the history
  • Loading branch information
Kooben209 authored and Kooben209 committed Mar 25, 2020
1 parent 85541ab commit 971074a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scraper.py
Expand Up @@ -118,8 +118,8 @@ def saveToStore(data):
advertMatch = {}
postKey = random.choice(list(postTemplates))

if advert.find("span", {"class" : "propertyCard-branchSummary-branchName"}) is not None:
agent = advert.find("span", {"class" : "propertyCard-branchSummary-branchName"}).text
if advert.find("div", {"class" : "propertyCard-branchLogo"}).find("a" , {"class" : "propertyCard-branchLogo-link"}) is not None:
agent = advert.find("div", {"class" : "propertyCard-branchLogo"}).find("a" , {"class" : "propertyCard-branchLogo-link"}).get("title")
if any(x in agent.lower() for x in excludeAgents):
continue

Expand All @@ -128,7 +128,7 @@ def saveToStore(data):
propLink="https://www.rightmove.co.uk"+advert.find("a", {"class" : "propertyCard-link"}).get('href')
propId=re.findall('\d+',propLink)
title = advert.find("h2", {"class" : "propertyCard-title"}).text
address = advert.find("address", {"class" : "propertyCard-address"}).find("span").text
address = advert.find("address", {"class" : "propertyCard-address"}).text
link = advert.find("a", {"class" : "propertyCard-link"})
price = parseAskingPrice(advert.find("div", {"class" : "propertyCard-priceValue"}).text)
displayPrice = advert.find("div", {"class" : "propertyCard-priceValue"}).text
Expand Down

0 comments on commit 971074a

Please sign in to comment.