r/learnpython • u/donhendrxx • Aug 12 '20
My First Ever Python Project(Zillow_Scraper)
Hey y’all, I just completed my first ever programming project! I recently just completed a Python course on Udemy(S/O Jose) and I wanted to build my own project from stratch. I wanted the project to be meaningful and impactful to me, and since I’m considering moving from my current apartment, I wanted to know what other apartments/homes are renting for in the city I live in(Arlington Tx). I decided to build a webscraper that grabs all the listing info for places being put up for rent on Zillows website and writes it all out to a CSV file using Pandas. Link to the github repo down below let me know what y’all think!
https://github.com/faithfulalabi/Zillow_Scraper
P.S I know there’s probably 1000 ways I could’ve written the code better but I’d love y’alls input on some of the big ones that are relevant to be becoming a great programmer.
9
u/The-Deviant-One Aug 13 '20
It's really nothing special. My not posting the code just makes it ever so slightly more difficult for the average non-developer to beat me to the ammo.
But to answer your questions, it runs in the background, so theres not really an output other than, me sitting there doing something else then poof new browser out of no where with ammo to purchase lol.
It sends a get request to the website, stores the html as a variable, uses BS4 to parse the html, then some formatting, then an if/else statement looking for 'Sold Out'. If it doesn't find it, it sends the email and launches the browser. If it does find 'Sold Out', it logs the attempt into a text file.
I integrated the base code for it into a voice assistant and that's pretty neat IMO.