So this is a really simple python scrapper. It worked on the search result page of realestate.au ONLY. And at this state it can only pull data from one single page. I am writing this article just to go through the code again.
import requests from urllib.request import urlopen from bs4 import BeautifulSoup
## open the webpage using bs def(url): html_page = requests.get(url)
if html_page.status_code != 200: print("invalid url, please check",html_page.status_code) else: return html_page.text ## why there is a text format webpage??
site = 'https://www.realestate.com.au/rent/in-2033/list-1?source=location-search' html = get_webpage(site) soup = BeautifulSoup(html, "lxml")
近期评论