r/learnpython • • Nov 27 '19

Black Friday hack with python

So I just finished my python script to monitor the price of my target gadget this holiday. It’s going to be heavily discounted soon but it will go to the fastest finger.

I’ve written a python script with BeautifulSoup. I’ve also set email and SMS alerts in the script 😂😂

Was just wondering if there’s any other person doing this for Black Friday and Fastest Finger deals.

Update: Long overdue but just thought I should add that I got the phone.

362 Upvotes

100 comments sorted by

View all comments

Show parent comments

3

u/[deleted] Nov 27 '19

[removed] — view removed comment

8

u/TheAmazingJames Nov 27 '19

Selenium is way way slower and memory heavy. Selenium should only be used if you need JavaScript to render/work.

2

u/Mathew_Berrys_Cock Nov 27 '19

Would more ram help this problem?

2

u/TheAmazingJames Nov 27 '19

Selenium’s usually using chromium in the background so it’s unlikely to max out your RAM unless you’re trying to run on a barebones setup, but it will be using significantly more than a requests/beautifulsoup setup and that could be costly if you’re running it in the cloud. The main reason not to though is speed. Typically I’d expect requests to run 5-10x faster than selenium. Selenium also requires more maintenance in terms of chromedriver updates and is harder to deploy on others’ systems. I’m not saying Selenium isn’t awesome, but it’s for specific use cases where you’re either browser testing or need JavaScript.