Code Monkey home page Code Monkey logo

Comments (10)

SpikeHD avatar SpikeHD commented on August 18, 2024

This is a weird one, I'll let you know when I've got a solution. In the meantime, what country's Amazon are you using?

from amazonmonitor.

mclenz avatar mclenz commented on August 18, 2024

Hey there, I'm looking at US Amazon.

Thanks for looking into it!

from amazonmonitor.

SpikeHD avatar SpikeHD commented on August 18, 2024

Tried doing the same thing and it worked fine. Was there any more to the console output? Can you try it with the debugEnabled config option set to true, and send me the entire output?

from amazonmonitor.

mclenz avatar mclenz commented on August 18, 2024

Here's the output with debug enabled:

##########################################################################
  _____                                        __      __         __         .__
 /  _  \   _____ _____  ____________   ____   /  \    /  \_____ _/  |_  ____ |  |__   ___________
/  /_\  \ /     \\__  \ \___   /  _ \ /    \  \   \/\/   /\__  \\   __\/ ___\|  |  \_/ __ \_  __ \
/    |    \  Y Y  \/ __ \_/    (  <_> )   |  \  \        /  / __ \|  | \  \___|   Y  \  ___/|  | \/
\____|__  /__|_|  (____  /_____ \____/|___|  /   \__/\  /  (____  /__|  \___  >___|  /\___  >__|
       \/      \/     \/      \/          \/         \/        \/          \/     \/     \/
 by SpikeHD#3336
 ##########################################################################

[MESSAGE]  Loading command: details.js
[MESSAGE]  Loading command: help.js
[MESSAGE]  Loading command: search.js
[MESSAGE]  Loading command: unwatch.js
[MESSAGE]  Loading command: watch.js
[MESSAGE]  Loading command: watchlist.js
[DEBUG]  Data storage type: json
[MESSAGE]  Watchlist Loaded
[MESSAGE]  Puppeteer Launched
[LOG]  Checking item prices...
[MESSAGE]  Type: headless
[MESSAGE]  Waiting a couple seconds for JavaScript to load...
[DEBUG]  Got page in 7680ms
[MESSAGE]  Type: electronics

               computers & accessories

               computer components

               internal components

                cpu processors
[DEBUG]  Detected as a regular item
[DEBUG]  Full object:
[DEBUG]  {
 full_title: 'AMD Ryzen 7 5800X 8-core, 16-Thread Unlocked Desktop Processor Without Cooler',
 full_link: 'https://www.amazon.com/dp/B0815XFSGK/??',
 asin: 'B0815XFSGK',
 seller: 'Visit the AMD Store',
 price: '',
 symbol: '',
 shipping: 'Free with prime',
 rating: '4.7 out of 5 stars',
 features: [
   ' - Make sure this fits\nby entering your model number.',
   ' - Make sure this fits\nby entering your model number.',
   ' - by entering your model number.',
   " - AMD's fastest 8 core processor for mainstream desktop, with 16 procesing threads",
   " - Can deliver elite 100+ FPS performance in the world's most popular games",
   ' - Cooler not included, high-performance cooler recommended',
   ' - 4.7 GHz Max Boost, unlocked for overclocking, 36 MB of cache, DDR-3200 support',
   ' - For the advanced Socket AM4 platform, can support PCIe 4.0 on X570 and B550 motherboards'
 ],
 availability: 'Available from these sellers.\n\n\n\n\n\n\n\n\n\nAvailable from these sellers.',
 image: 'https://images-na.ssl-images-amazon.com/images/I/61DYLoyNRWL._AC_SL1384_.jpg'
}
[WARNING]  Detected 2 empty values. Could potentially mean bot was flagged
[MESSAGE]  Type: headless
[MESSAGE]  Waiting a couple seconds for JavaScript to load...
[DEBUG]  Got page in 6289ms
[MESSAGE]  Type: electronics

               computers & accessories

               computer components

               internal components

                cpu processors
[DEBUG]  Detected as a regular item
[DEBUG]  Full object:
[DEBUG]  {
 full_title: 'AMD Ryzen 9 5900X 12-core, 24-Thread Unlocked Desktop Processor Without Cooler',
 full_link: 'https://www.amazon.com/dp/B08164VTWH/??',
 asin: 'B08164VTWH',
 seller: 'Visit the AMD Store',
 price: '',
 symbol: '',
 shipping: 'Free with prime',
 rating: '4.8 out of 5 stars',
 features: [
   ' - Make sure this fits\nby entering your model number.',
   ' - Make sure this fits\nby entering your model number.',
   ' - by entering your model number.',
   " - The world's best gaming desktop processor, with 12 cores and 24 processing threads",
   " - Can deliver elite 100+ FPS performance in the world's most popular games",
   ' - Cooler not included, high-performance cooler recommended',
   ' - 4.8 GHz Max Boost, unlocked for overclocking, 70 MB of cache, DDR-3200 support',
   ' - For the advanced Socket AM4 platform, can support PCIe 4.0 on X570 and B550 motherboards'
 ],
 availability: 'Currently unavailable.',
 image: 'https://images-na.ssl-images-amazon.com/images/I/616VM20%2BAzL._AC_SL1384_.jpg'
}
[WARNING]  Detected 2 empty values. Could potentially mean bot was flagged
[MESSAGE]  Type: headless
[MESSAGE]  Waiting a couple seconds for JavaScript to load...
[DEBUG]  Search phrase: Ryzen 9
[MESSAGE]  Type: headless
[MESSAGE]  Waiting a couple seconds for JavaScript to load...
[DEBUG]  Got page in 2436ms
[MESSAGE]  Type:
[DEBUG]  Detected as a regular item
[DEBUG]  Full object:
[DEBUG]  {
 full_title: '',
 full_link: 'https://www.amazon.com/dp/B0815Y8J9N/??',
 asin: 'B0815Y8J9N',
 seller: '',
 price: '',
 symbol: '',
 shipping: 'Free with prime',
 rating: '',
 features: [],
 availability: '',
 image: 'https://via.placeholder.com/300x300.png?text=No+Image'
}
[WARNING]  Detected 7 empty values. Could potentially mean bot was flagged
[DEBUG]  Got page in 2391ms
[ERROR]  TypeError: Cannot read property 'forEach' of null
   at Object.module.exports.run (/usr/src/app/commands/search.js:29:8)
   at processTicksAndRejections (node:internal/process/task_queues:93:5)
   at async exec (/usr/src/app/index.js:69:3)
/usr/src/app/node_modules/discord.js/src/rest/RequestHandler.js:170
         return reject(new DiscordAPIError(request.path, data, request.method, res.status));
                       ^
DiscordAPIError: Cannot send an empty message
   at RequestHandler.execute (/usr/src/app/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
   at processTicksAndRejections (node:internal/process/task_queues:93:5) {
 method: 'post',
 path: '/channels/*REDACTED*/messages',
 code: 50006,
 httpStatus: 400
}

from amazonmonitor.

SpikeHD avatar SpikeHD commented on August 18, 2024

Well, I can't be sure about why it would be failing to output search results, but I do see the problem with quickwatch, and will try to push a fix later.

from amazonmonitor.

mclenz avatar mclenz commented on August 18, 2024

Not sure if it is at all related, but I also noticed several of my watchlist items don't have a title, but one does:

List of Amazon items currently being watched
1.
https://www.amazon.com/dp/B0815XFSGK/

2.
https://www.amazon.com/dp/B08164VTWH/

3.
https://www.amazon.com/dp/B0815Y8J9N/

4.
https://www.amazon.com/dp/B08P7SBD3Q/

5.
https://www.amazon.com/dp/B08NXVNMPQ/

6. Razer Naga Pro Wireless Gaming Mouse: Interchangeable Side Plate w/ 2, 6, 12 Button Configurations -...
https://www.amazon.com/dp/B08D27XXRY/
Currently watching 6 items in this server

from amazonmonitor.

mclenz avatar mclenz commented on August 18, 2024

Also, even though the 6th watchlist item has a valid price, it did not pull the price (or so it seems). The watchlist.json file shows price of 0, but Amazon's site shows 149.99

    "link": "https://www.amazon.com/dp/B08D27XXRY/?",
    "lastPrice": 0,
    "item_name": "Razer Naga Pro Wireless Gaming Mouse: Interchangeable Side Plate w/ 2, 6, 12 Button Configurations - Focus+ 20K DPI Optical Sensor - Fastest Gaming Mouse Switch - Chroma RGB Lighting",
    "priceLimit": 0,
    "type": "link"

*** UPDATE ***

I unwatched and re-watched, for some reason now it's showing the 149.99 price for the 6th item.

from amazonmonitor.

SpikeHD avatar SpikeHD commented on August 18, 2024

Usually, it's a bad sign when the bot gets the page in around 2000ms instead of about 6000ms, as well as the "Empty values" warning. Usually this means that the page Amazon returns is not the page of the item, but a captcha or other form of rate-limiting. Best thing you can do in that scenario is stop the bot for a little while, go onto Amazon from a browser and make sure it works fine that way, and try again in a few minutes.

There is no real fix for this other than waiting, unfortunately.

from amazonmonitor.

mclenz avatar mclenz commented on August 18, 2024

I think you're right. I stopped the bot, and ran a curl command manually, and see this:

        <div class="a-box a-alert a-alert-info a-spacing-base">
            <div class="a-box-inner">
                <i class="a-icon a-icon-alert"></i>
                <h4>Enter the characters you see below</h4>
                <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="Q6WewgCroX9xOtMN562xdw==" /><input type=hidden name="amzn-r" value="&#047;Razer&#045;Naga&#045;Wireless&#045;Gaming&#045;Mouse&#047;dp&#047;B08D27XXRY&#047;ref&#061;sr_1_1_sspa?dchild&#061;1" />

I wasn't aware of the captcha's Amazon does just for browsing pages, probably because I usually do it as a human manually. That's a bit of a bummer. I guess I'll wait a while and see if that goes away, and if so, set the interval for every 5 min or so maybe.

Thanks for checking in on it, and sorry for wasting your time!

from amazonmonitor.

SpikeHD avatar SpikeHD commented on August 18, 2024

No worries! It's not the most clear of issues. I'll see about making the interval a tweak-able setting in order to try and prevent stuff like this.

from amazonmonitor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.