Hello,
i tried to test the script with an available product : https://www.amazon.it/Just-Dance-2021-PlayStation-4/dp/B08HJM7PX6
so i modified the locations object of the script like this :
locations = { 'Just Dance 2021': { 'webshop': 'amazon-it', 'url': 'https://www.amazon.it/Just-Dance-2021-PlayStation-4/dp/B08HJM7PX6', 'inStock': False, 'inStockLabel': "submit.add-to-cart-announce", 'outOfStockLabel': "Non disponibile", 'detectedAsBotLabel': "please contact api-services-support@amazon.com"}, }
then i run the script. Here is what i got : [04:11:04] [ OUT OF STOCK ] [ Just Dance 2021 ]
I tried to do a simple script by myself, and my script can recognize that the product is in stock :
`
from rich.console import Console
import requests
import random
console = Console()
referers = [
'http://www.bing.com/',
'http://www.google.com/',
'https://search.yahoo.com/',
'http://www.baidu.com/',
'https://duckduckgo.com/'
]
referer = random.choice(referers)
with open('resources/user-agents.txt') as f:
user_agents = f.read().splitlines()
f.close()
user_agent = random.choice(user_agents)
headers = {
"User-Agent": user_agent,
"Accept-Encoding": "gzip, deflate",
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9',
'accept-language': 'en-GB,en-US;q=0.9,en;q=0.8',
'sec-fetch-site': 'same-origin',
'sec-fetch-mode': 'navigate',
'sec-fetch-user': '?1',
'sec-fetch-dest': 'document',
'referer': referer,
"Connection": "close", "Upgrade-Insecure-Requests": "1"
}
inStockLabel = "submit.add-to-cart-announce"
content = requests.get('https://www.amazon.it/Just-Dance-2021-PlayStation-4/dp/B08HJM7PX6', timeout=5, headers=headers).content.decode('utf-8')
if (inStockLabel in content ):
console.log("OMG, IN STOCK!")
`
then i finally got :
[04:15:46] OMG, IN STOCK!
Do you know if it's normal or not ?
Hello,
i tried to test the script with an available product : https://www.amazon.it/Just-Dance-2021-PlayStation-4/dp/B08HJM7PX6
so i modified the locations object of the script like this :
locations = { 'Just Dance 2021': { 'webshop': 'amazon-it', 'url': 'https://www.amazon.it/Just-Dance-2021-PlayStation-4/dp/B08HJM7PX6', 'inStock': False, 'inStockLabel': "submit.add-to-cart-announce", 'outOfStockLabel': "Non disponibile", 'detectedAsBotLabel': "please contact api-services-support@amazon.com"}, }then i run the script. Here is what i got : [04:11:04] [ OUT OF STOCK ] [ Just Dance 2021 ]
I tried to do a simple script by myself, and my script can recognize that the product is in stock :
`
from rich.console import Console
import requests
import random
console = Console()
referers = [
'http://www.bing.com/',
'http://www.google.com/',
'https://search.yahoo.com/',
'http://www.baidu.com/',
'https://duckduckgo.com/'
]
referer = random.choice(referers)
with open('resources/user-agents.txt') as f:
user_agents = f.read().splitlines()
f.close()
user_agent = random.choice(user_agents)
headers = {
"User-Agent": user_agent,
"Accept-Encoding": "gzip, deflate",
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9',
'accept-language': 'en-GB,en-US;q=0.9,en;q=0.8',
'sec-fetch-site': 'same-origin',
'sec-fetch-mode': 'navigate',
'sec-fetch-user': '?1',
'sec-fetch-dest': 'document',
'referer': referer,
"Connection": "close", "Upgrade-Insecure-Requests": "1"
}
inStockLabel = "submit.add-to-cart-announce"
content = requests.get('https://www.amazon.it/Just-Dance-2021-PlayStation-4/dp/B08HJM7PX6', timeout=5, headers=headers).content.decode('utf-8')
if (inStockLabel in content ):
console.log("OMG, IN STOCK!")
`
then i finally got :
[04:15:46] OMG, IN STOCK!
Do you know if it's normal or not ?