eyalzek / price-alert

Script to send an email when a price drops below a given value (tested on Amazon).
78 stars 34 forks source link

Amazon expecting capcha #15

Open mfraser opened 3 years ago

mfraser commented 3 years ago

Just tried to run price-alert and I was getting the

Didn't find the 'price' element, trying again later

Now it looks like Amazon is wanting me to enter a Captcha.

Enter the characters you see below

            <p class="a-last">Sorry, we just need to make sure you're not a robot. For best results, please make sure your browser is accepting cookies.</p>
            </div>
        </div>

        <div class="a-section">

            <div class="a-box a-color-offset-background">
                <div class="a-box-inner a-padding-extra-large">

                    <form method="get" action="/errors/validateCaptcha" name="">
                        <input type=hidden name="amzn" value="0bg/HZ5wHJqUobhCg6n1/w==" /><input type=hidden name="amzn-r" value="&#047;dp&#047;B07KKBCXLY" />
                        <div class="a-row a-spacing-large">
                            <div class="a-box">
                                <div class="a-box-inner">
                                    <h4>Type the characters you see in this image:</h4>
                                    <!-- For automated access to price change or offer listing change events,
                                         please refer to the MWS Subscription API:
                                         https://developer.amazonservices.co.uk/gp/mws/api.html/276-5247872-0590350?ie=UTF8&section=subscriptions&group=subscriptions&version=latest
eyalzek commented 3 years ago

Can you share the config you're using (minus the email part) ?

mfraser commented 3 years ago

{ "email": { }, "base_url": "https://www.amazon.co.uk/dp/", "xpath_selector": "//*[@id=\"priceblock_ourprice\"]", "items": [ ["B07VS31PLC", 50], ["B0832VWWD1", 80], ["B07KKBCXLY", 27] ] }

eyalzek commented 3 years ago

It works for me. Which country are you connecting from? Are you using a VPN?

mfraser commented 3 years ago

I am in the UK and not on a VPN.

All I get is "Didn't find the 'price' element, trying again later"

eyalzek commented 3 years ago

If you're trying to go to one of these pages in a private windows (incognito), e.g: https://www.amazon.co.uk/dp/B07VS31PLC https://www.amazon.co.uk/dp/B0832VWWD1 https://www.amazon.co.uk/dp/B07KKBCXLY

does it look ok or is it prompting for captcha?

mfraser commented 3 years ago

It is only asking to accept cookies.

eyalzek commented 3 years ago

You can try adding some more headers like here: https://stackoverflow.com/a/63675657

Other than that there's not much I can do if I can't reproduce it myself.. Did it work for a while and then stop, or were you seeing the same behavior since the first request?

VasiRoum commented 3 years ago

hello. 1st of all, respect. 2nd, in another site i am trying price-alert it has only class,not id before the price section and i cannot load this in the json file. do u suggest any solutions?

eyalzek commented 3 years ago

Which site? The config just holds the XPath selector to the element, it should work with a class also. You can get the XPath for the element when inspecting it, then right click and copy as XPath.

VasiRoum commented 3 years ago

Zara. has no id. And even if i right click and get the Xpath, still doesn't work :( Update: All g man, i am simply idiot! thanks for the response and nice work guys!