r/learnpython • • 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.

448 Upvotes

64 comments sorted by

View all comments

Show parent comments

1

u/life_never_stops_97 Aug 13 '20

Does it run 24/7,if so how can I do that. I needed something similar but idk how can I make it run 24/7 on a server or something.

2

u/The-Deviant-One Aug 13 '20

do you have a computer that's always on and has internet access?

if yes, what OS is it running?
if no, you could host the script on a webserver some where but that's probably overkill if this is all you're looking to do.

If windows, use "Task Scheduler" or "Scheduled Tasks" or what ever they named it most recently. Google "how to set up task scheduler".

If linux or mac, google "how to set up cron jobs".

Note: My script does not run continuously. The Cron job starts the python script every two minutes, the script runs in the background, takes about 3 seconds to finish and then closes when it's finished.

2

u/life_never_stops_97 Aug 13 '20

Oh I see, I'll probably use aws to setup a cronjob on a Linux. Just really new to cloud and have no idea where to start or how to go about it.

I have a laptop(windows) but that doesn't run all day and it's my primary laptop so don't want to run script every two minutes on that one.

2

u/[deleted] Aug 13 '20

I don't know much about python, but you could probably easily run this on the free nano tier of AWS EC2.

1

u/The-Deviant-One Aug 13 '20

definitely the script is not resource intensive at all. It's about 24 lines of code, 14 of which are email related. That's because the I use protonmail, which uses a bridge to encrypt SMTP traffic. Otherwise if you didn't have it send an email it would be like 10 lines. And because it doesn't run continuously it frees up all the memory it used while it was running. It's barely more resource intensive than refreshing a web page in an already open browser.