RaffaeleNachos / Website-Checker

This super simple code in Python checks if a keyword or string is found in a Webpage or Website.
0 stars 0 forks source link

banggood uses an ajax call #1

Open RaffaeleNachos opened 6 years ago

RaffaeleNachos commented 6 years ago

While talking with friends, Simone Diamanti discovers that Banggood uses a jQuery ajax call. The message says if the product is in stock or not.

ajax

nmaggioni commented 6 years ago

I poked around a bit, and the query seems to be varying quite a lot from product to product: for SKUs that have for example more than one color (or any other variable option, be it RX brand or even which warehouse they are shipped from) both the request and the reply change in content and form.

It'd be better to use BG's stock API, even though it requires per-user registration (a single access token is rate-limited and therefore cannot be made available at project level), its documentation is missing pages and is overall poorly translated...

If this is the route that you want to pursue, I'd take a look at something like Puppeteer (available for NodeJS only at the moment). FWIW I recall that Selenium was the go-to browser automation suite for Python.