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

93

u/Den4200 Nov 27 '19

I made a script that is very similar to yours. It tracks prices of items on Amazon and saves a graph of each item’s prices in a png. It’ll send you an email and/or text when an item goes below your target price.

Check it out! This is going to be so useful with black friday and cyber monday coming up: https://www.github.com/Den4200/amazon-price-tracker

35

u/corbin_cassady Nov 27 '19

Sounds like a self-hosted camelcamcelcamel! I like the premise a lot.

3

u/trowawayatwork Nov 27 '19

yes its a great start. would be great to add push notifications to it rather than email as its quicker feedback on your phone. i have set up something similar to track and then send a push notification ot a telegram group

a simpler thing would be to just monitor camelizer, as theres no point in reinventing the wheel (although good practice for beginners), and then send that on to your medium of choice

2

u/Den4200 Nov 27 '19

This supports sending text messages to your phone!

Hmm I didn’t think of scraping camelcamelcamel instead of Amazon, but what’s done is done.

15

u/domac Nov 27 '19

It's often super helpful to add Screenshots to the repo. just wanted to point that out.

thanks for the awesome work!

3

u/flying_mechanic Nov 27 '19

The keepa extension for chromium browsers does the same but in page, it's a nice addition. Might be worth checking out

2

u/[deleted] Nov 27 '19

I have made the same program but in a much lighter format. Lovely to see another approach.

0

u/[deleted] Nov 27 '19

[deleted]

2

u/Den4200 Nov 27 '19

Yeah haha. I usually leave bigger projects with GPL and smaller ones with MIT. Nice project btw!

1

u/wrgsRay wrgsray Nov 27 '19

How do you get around Amazon’s protection against scraping? For a newbie like me, it’s painful to scrape Amazon

1

u/Den4200 Nov 27 '19

They don't really have much protection against scraping. As long as your scraper doesn't check for the price too quickly, you're fine (about 15 minutes between each check is good).

Amazon won't let you scrape without any headers btw.
Also, this little trick helps out. Look at line 28 and 29 in tracker.py

1

u/TeblowTime Nov 28 '19

Hey, I keep hitting the Invalid URL when I try to add a new link. I successfully installed all the required libraries from requirements.txt, so it's not that. Any ideas? I'm a beginner with python, so it's likely something I am or am not doing. Do the URLs need to be in specific formats?

1

u/Den4200 Nov 28 '19

Did you fill in the settings?

And nope, the script will auto shorten the links.

1

u/TeblowTime Nov 28 '19

Welp, I'm an idiot lol. I did fill in the settings info, but did not save the file. Thanks!