Amazon buying bot

HavocXphere

Honorary Master
Joined
Oct 19, 2007
Messages
33,153
Reaction score
1,297
Location
Europe
I buy pretty much everything except perishable food off Amazon, so I've got price alerts set up on camelcamelcamel.

Problem is lately I'm getting alerts where by the time I get home the price has been pushed up again. So sellers are obviously using a bot and possibly even intentionally triggering alerts to get me to look at their page. Look at these fkin shenanigans:

Price Shenanigans.JPG

I'd say 15 is about fair market price in the above example.

A watchlist is no longer cutting it & thinking of setting up a buying bot. And if you check the price differential on the above example we're talking real money savings if I can catch the price on the bottom end.

So far so good.

Part where I need advice from the programming crew:

Scrape Amazon directly or rely on camel's emails as a trigger? Camel is probably programatically easier, but bit of research shows it introduces a 2 hour delay into the equation (their scraping cycle). Neither has an API.

If I scrape directly what are the chances of Amazon nix'ing that as malicious web traffic?

Given that this thing will be armed with a credit card how would you go about doing this somewhat safely? :o (Aside from the obvious if toothpaste bought don't buy more type code).

Current thinking is Selenium via Python running on a raspberry pi that is on 24/7. And probably hourly scraping over say 40 products.

Thoughts?
 
Uhm.....wat?
Prices on Amazon fluctuate.
He wants to buy items when prices are low, using a bot to automate the process.

Kinda like setting up a limit order on an exchange: When the price of some asset reaches a certain value: buy it.

In the meantime, you're presumably already getting an email alert with a link to the product - why not just buy the item via Amazon app on your phone? But yeah - I'm sure you don't want to be buying 7 things in a day and having to keep track of what you've bought etc.
 
In the meantime, you're presumably already getting an email alert with a link to the product - why not just buy the item via Amazon app on your phone? But yeah - I'm sure you don't want to be buying 7 things in a day and having to keep track of what you've bought etc.
Exactly.

I average about a purchase every 3 days or so, so it's not a fringe event I want to automate here. And if I can shave a pound or two off the price here & there it'll be a fair bit of money over the years.

The alerts do kinda work, but it's a bit of a pain. It's also not particularly clever. e.g. There are dozens of listings for a product - say Mach 3 blades - in a variety of package sizes & as I said they fluctuate hourly.

So instead of sitting there with a spreadsheet working out which is best I'd rather prefer to load it as a category, have the program work out cost per unit and monitor all of them in parallel so that when I set it to buy blades it gets the best option (or waits if no prices are good).
 
Also want to do keyword searches over their warehouse deals (i.e. opened boxes) so that I can snap up the good stuff. That will probably not be automated buying though.
 
lol, ok, think the hangover also din't help me much. But can't help but think, is Golgate Mouthwash better to buy from outside the country? Is it that much cheaper? Seems to me a lot of trouble for mouthwash.
 
lol, ok, think the hangover also din't help me much. But can't help but think, is Golgate Mouthwash better to buy from outside the country? Is it that much cheaper? Seems to me a lot of trouble for mouthwash.
He lives in Europe / America or something where he has access to Amazon.
Eish.
 
lol, ok, think the hangover also din't help me much. But can't help but think, is Golgate Mouthwash better to buy from outside the country? Is it that much cheaper? Seems to me a lot of trouble for mouthwash.
Yeah I've got access to Amazon Prime so no shipping costs & pricing is equal/better to what the local supermarkets have...else this would be a 10/10 idiotic plan. :D
 
Wohoo...success. Logs in fine and can scrape a product's info:

Code:
URL: https://smile.amazon.co.uk/Kleenex-Mansize-Tissues-Compact-Total/dp/B004OCO1R8/ref=pd_nav_hcs_rp_t_1
Description: Kleenex Mansize Tissues, Compact - Pack of 24 (1056 Tissues Total)
Price: 23.64
Delivery: 0.0
Free shipping: True
Seller is amazon: True
Total cost: 23.64
Info good: True

Pretty chuffed since this is my first python program that does something complicated. Lot's of happy path coding though tbh...
 
Did stuff like this once for a kinda shady dude. Just make sure you're not doing too many calls or Amazon will ban your IP/account. Scraping is technically against their TOS and they're pretty liberal with banning. We ended up switching proxies several times to make sure we weren't deteced as a bot.

https://github.com/stylesuxx/amazon-bot might give you some foundations to work off as well

Recommended reading: https://www.quora.com/What-steps-does-Amazon-com-take-to-make-screen-scraping-difficult
 
Wohoo...success. Logs in fine and can scrape a product's info:

Code:
URL: https://smile.amazon.co.uk/Kleenex-Mansize-Tissues-Compact-Total/dp/B004OCO1R8/ref=pd_nav_hcs_rp_t_1
Description: Kleenex Mansize Tissues, Compact - Pack of 24 (1056 Tissues Total)
Price: 23.64
Delivery: 0.0
Free shipping: True
Seller is amazon: True
Total cost: 23.64
Info good: True

Pretty chuffed since this is my first python program that does something complicated. Lot's of happy path coding though tbh...

Sharing the code please.
 
Figured out how to disable images, CSS and javascript to speed things up and reduce data usage :D

Amazon's page is quite slow though - still take ~3 seconds to load everything and that's on fiber line. Dug through it - that's how low it takes Selenium to load the page completely. Nothing I can do about that. :(

Sharing the code please.
Here you go:

https://ufile.io/fligv

The code is still quite unreliable & flakey so take care
 
Code:
Products checked: 17
Least expensive: 1.1744999999999999
Avg cost:1.8472604323780795
Best option:
------------------------------------------------------------------------------------------------------
URL: https://smile.amazon.co.uk/Gillette-7702018349760-Mach3-Razor-Blades/dp/B0196HHEBU
Description: Gillette Mach3 Razor Blades
Price: 23.49
Delivery: 0
Free shipping: True
Seller is amazon: False
Total cost: 23.49
Units: 20
ASIN: B0196HHEBU
Merchant ID: A3P5ROKL5A1OLE
Selling ID: A3P5ROKL5A1OLE
Is Addon: 0
Info good: True
Cost per unit: 1.1744999999999999

Victory! Given a CSV file of products it can work out which one is best. Only manual input is the unit count...amazon doesn't standardize that info :(

Surprised at the range...some of the offers are almost triple the lowest
 
Top
Sign up to the MyBroadband newsletter
X