Created
August 30, 2020 11:51
-
-
Save lafftar/30bf3f5f076abc79f18d17f3013d038c to your computer and use it in GitHub Desktop.
GTA Cities Real Estate - 27 Cities - Quick Data Study - 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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