Skip to content

Instantly share code, notes, and snippets.

@lafftar
Created August 30, 2020 11:51
Show Gist options
  • Save lafftar/30bf3f5f076abc79f18d17f3013d038c to your computer and use it in GitHub Desktop.
Save lafftar/30bf3f5f076abc79f18d17f3013d038c to your computer and use it in GitHub Desktop.
GTA Cities Real Estate - 27 Cities - Quick Data Study - 3
url = f"https://{'-'.join(element.text.split()).lower()}.listing.ca/real-estate-prices-by-community.htm"
print(url)
resp = main_session.get(url)
print(resp.url)
listing_ca_page = bs(resp.content, 'lxml')
three_bed_home = listing_ca_page.find('a', attrs={'href': '/3-bedroom-detached-home'
'-prices-by-community.htm'})\
.next.next.text.strip() # avg price of detached 3 bedroom home
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment