zweed4u / Supreme

Supreme shopping automation via mobile app endpoints and webdriver
MIT License
97 stars 31 forks source link

Problem adding to cart #13

Closed ScratLpp closed 5 years ago

ScratLpp commented 5 years ago

Hi zweed4u,

I have a probleme to adding to cart. I have read the last issue but i think you have update your code, i find nothing to match.

`[[ Thread-1 ]] Cheetah Hooded :: Medium :: Black :: 1 :: Thread initialized! [119148:119152:0329/112233.580:ERROR:configuration_policy_handler_list.cc(90)] Unknown policy: remoteaccesshostdomain [119148:119152:0329/112233.848:ERROR:configuration_policy_handler_list.cc(90)] Unknown policy: remoteaccesshostdomain

DevTools listening on ws://127.0.0.1:56010/devtools/browser/80b57d77-d3ba-4e82-bd54-896cb00d083c [[ Thread-1 ]] 2019-03-29 11:22:35.588133 EST :: [[ Cheetah Hooded Station Jacket ]] 304183 found ( MATCHING ITEM DETECTED ) [[ Thread-1 ]] 2019-03-29 11:22:35.588133 EST :: [[ Cheetah Hooded Station Jacket ]] 304183 found ( MATCHING ITEM DETECTED ) [[ Thread-1 ]] 2019-03-29 11:22:35.590139 EST :: Selecting [[ Cheetah Hooded Station Jacket ]] ( 304183 ) [[ Thread-1 ]] 2019-03-29 11:22:35.709496 EST :: Selecting size for [[ Cheetah Hooded Station Jacket ]] - Medium ( Black ) ( 54994 ) [[ Thread-1 ]] 2019-03-29 11:22:35.709496 EST :: Adding [[ Cheetah Hooded Station Jacket ]] to cart... [[ Thread-1 ]] 2019-03-29 11:22:35.832854 EST :: Response Empty! - Problem Adding to Cart! [[ Cheetah Hooded Station Jacket ]] FAILED!`

I think it's a problem with size ?

Gaëtan

ScratLpp commented 5 years ago

Hummm no it's my color, i set black but in your file colorCodes.py you don't have it

It's possible to add black in this file ?

Edit : i have the same error with "Red"

zweed4u commented 5 years ago

Unable to reproduce; medium red and black Cheetah Hooded Station Jacket add to cart fine for me. Make sure they're in stock for your region.
colorCodes.py has nothing to do with variation of product it is simply for colored terminal output

ScratLpp commented 5 years ago

hi zweed4u,

I'm living to paris and this article is available for me on the website : http://prntscr.com/n4q2ek

I tried with many other article and i have the same error :/

EDIT : my config file :

[timeComponents]
poll = 3
ghostCheckoutPrevention = 5

[productName] #adjust/add more items here - just be sure to have the same number of products in each section(name, size, color, qty)
name1 = Cheetah

[productColor]
#String eg. 'Red'
color1 = red

[productSize]
#String eg. 'Medium', 'OS', 'N/A'
size1 = Medium

[productQty]
amount1 = 1

[cardInfo] #this is a config for billing the same as shipping address - card type option value = 'master', 'visa'
firstAndLast = blank for github
email = blank for github
phone = blank for github
address = blank for github
zip = blank for github
city = Paris
state = CA
country = France
cardType = visa
cardNumber = 9999 9999 9999 9999
cardMonth = 01
cardYear = 2026
cardCVV = 999
zweed4u commented 5 years ago

Sorry for the blurriness - there seems to be difference between different locale. I'll get around to checking it out later on. Here's a quick screen record on my end ezgif-5-0ea3d1bc454e

ScratLpp commented 5 years ago

Ok great, i look forward to try :)

thank's a lot for your reactivity

ScratLpp commented 5 years ago

You're right, i tried with VPN at US East and it's working. The problem is my country for ship ahah

ScratLpp commented 5 years ago

Hi zweed4u,

i would like to know if you could have check the issue ? Next thursday new logo box is available ahah

thanks for advance Gaëtan

zweed4u commented 5 years ago

Let me know if https://github.com/zweed4u/Supreme/commit/f926590c39687bae50ee1a2baea9513283b72d5c works for you

If it works for you on retry you can swap the keys in the first payload with the ones in the retry payload so the first atc request will succeed.

I'd like to find a way to dynamically figure these fields out but that would most likely require another request anyway so I have it as is. I also thought of hardcoding the keys by region with users specifying their region in the config but then it's a game of whack-a-mole if associations change.

Lastly I could always just make separate branches for different locales but once again that's depending things stay the same. I feel as though this is decent enough and will require users to be heads up to prioritize their region accordingly.

ScratLpp commented 5 years ago

I think if you hardcoding any region in world it's maybe lo of work for you ahah Also f926590 works for me, thank you, but i think other some things change between US and others country. In Shiping Payment Info, we don't have the field "State". I remove this in supreme.py but three others settings seems differents :

Couldn't find nnaerb field (card number) Click to continue automation... Couldn't find credit_card[rvv] field (card cvv) Click to continue automation... Couldn't find accept terms radio button Click to continue automation...

My config file is already configured with the good seetings :)

ScratLpp commented 5 years ago

The card "Month" and "Year" too, the default value on supreme website don't change

ScratLpp commented 5 years ago

And Couldn't find order billing country drowpdown/value Click to continue automation... too

ScratLpp commented 5 years ago

Ok it's good : Country i have enter the name FRANCE and not the value FR Credit cardNumber the id is cnb and not nnaerb CVV the id is vval And for radio boutton the seetings is : p:nth-child(5) and not 4

It's good for this country issue the bot run with no error but i have didn't cop for other reason i create a new issue ahah :p

zweed4u commented 5 years ago

@ScratLpp https://github.com/zweed4u/Supreme/commit/1e2b26a4934a9e0b65d79c02e31a9db09e5bb7e1 adds lists for "selector" specification. As a user you can go in and manually edit elements listed. Be warned that most actually aren't selectors but ids and names of DOM elements. Minor improvement but I feel as though I should let you know as it kind of hits on your last comment for other regions.

ScratLpp commented 5 years ago

@zweed4u Yes my modification is not very compliant for a properly code.. you're right ! But i don't understand how i can find the elements listed for change manually the different settings :/

zweed4u commented 5 years ago

Add the DOM selectors/id/names in the arrays: https://github.com/zweed4u/Supreme/commit/1e2b26a4934a9e0b65d79c02e31a9db09e5bb7e1#diff-5b1383d89803b0046027c5213cf56081R123 https://github.com/zweed4u/Supreme/commit/1e2b26a4934a9e0b65d79c02e31a9db09e5bb7e1#diff-5b1383d89803b0046027c5213cf56081R143 ...etc and make any adjustments to the webdriver methods ie: https://github.com/zweed4u/Supreme/commit/1e2b26a4934a9e0b65d79c02e31a9db09e5bb7e1#diff-5b1383d89803b0046027c5213cf56081R128 https://github.com/zweed4u/Supreme/commit/1e2b26a4934a9e0b65d79c02e31a9db09e5bb7e1#diff-5b1383d89803b0046027c5213cf56081R130 https://github.com/zweed4u/Supreme/commit/1e2b26a4934a9e0b65d79c02e31a9db09e5bb7e1#diff-5b1383d89803b0046027c5213cf56081R147 https://github.com/zweed4u/Supreme/commit/1e2b26a4934a9e0b65d79c02e31a9db09e5bb7e1#diff-5b1383d89803b0046027c5213cf56081R149