alexschimpf / Snkrs-Bot

Selenium bot for Nike Snkrs site
The Unlicense
847 stars 289 forks source link

Cannot login #5

Open sherryhw opened 5 years ago

sherryhw commented 5 years ago

2019-02-12 22:08:32,450 [PID 6067] [Thread 140736427754432] [INFO] [root] Waiting for login button to become clickable It stuck at this place. Can you give me any hint for this issue?

The script I am using is python main.py --username 'username' --password 'password' --url 'https://www.nike.com/launch/t/XXXXX' --shoe-size 36.5 --driver-type 'firefox'

Thanks!

alexschimpf commented 5 years ago

Based on that non-US shoe size, I'm wondering if nike.com is redirecting you to some non-US version of the site, which might cause issues. You can use the html-path and screenshot-path script params to help you debug what's going on. Essentially, you'll need to inspect the HTML and see why the XPATH isn't working right.

sherryhw commented 5 years ago

Hi I tried the 6.5 and 6. both of them are not working

alexschimpf commented 5 years ago

The size you specify isn't related to the login. I'm just saying the code is waiting for the login button to become clickable. For whatever reason, the button HTML it's looking for is not there. Can you post the HTML you're seeing for the login button?

sherryhw commented 5 years ago

Not sure what HTML you just referred. I use inspect to see the Join/Login button and see this,

Not sure if this is something you need

alexschimpf commented 5 years ago

Right-click the button on the page and click 'Inspect' or 'Inspect Element'. This will take you to the HTML for the button. Please paste the HTML you see for it.

sherryhw commented 5 years ago

<li class="member-nav-item d-sm-ib va-sm-m"><div id="AccountNavigationContainer" style="display: block;"><button style="display:block" class="nav-btn p0-sm prl3-sm pt2-sm pb2-sm fs12-nav-sm d-sm-b nav-color-grey hover-color-black" target="_self" data-hfjs="InstrumentedAnchor" data-type="click_navJoinLogin" data-path="join or login"><span>Join / Log In To Nike⁠Plus Account</span></button><div id="AccountNavigationDropdown" class="hf-dropdown-menu header-dropdown" style="display:none" data-hfjs="DropdownMenu"><a role="listbox" aria-expanded="false" aria-controls="AccountNavigationDropdown-Menu" id="MyAccountLink" class="hover-color-black nav-btn nav-color-grey prl3-sm pt2-sm pb2-sm fs12-nav-sm d-sm-b" href="https://www.nike.com/member/profile" target="_self" data-hfjs="InstrumentedAnchor" data-type="click_navAccount" data-path="my account"><div class="hf-avatar d-sm-ib" data-hfjs="Avatar"><i aria-hidden="true" class="g72-profile fs16-nav-sm mr2-sm" style="display:inline-block"></i><img alt="Avatar" class="hf-avatar-image mr2-sm va-sm-m" style="display:none"></div><div class="hf-inbox-notification-dot" style="display:none" data-hfjs="InboxNotificationDot"></div><span>My Account</span></a><div id="AccountNavigationDropdown-Menu" class="dropdown-menu-box" style="display:none"><ul class="z4"><li><a href="https://www.nike.com/member/profile/" role="option" aria-selected="false" class="fs12-nav-sm hover-color-grey" target="_self" data-hfjs="InstrumentedAnchor" data-type="click_navAccount" data-path="myAccount:profile">Profile</a></li><li><a href="https://www.nike.com/orders" role="option" aria-selected="false" class="fs12-nav-sm hover-color-grey" target="_self" data-hfjs="InstrumentedAnchor" data-type="click_navAccount" data-path="myAccount:orders">Orders</a></li><li><a href="https://store.nike.com/us/en_us/?l=shop,mylocker" role="option" aria-selected="false" class="fs12-nav-sm hover-color-grey" target="_self" data-hfjs="InstrumentedAnchor" data-type="click_navAccount" data-path="myAccount:wish list">Wish List</a></li><li><a href="https://www.nike.com/member/inbox" role="option" aria-selected="false" class="fs12-nav-sm hover-color-grey" target="_self" data-hfjs="InstrumentedAnchor" data-type="click_navAccount" data-path="myAccount:inbox">Inbox</a></li><li><a href="https://web.nike.com/events/my_events/index.html" role="option" aria-selected="false" class="fs12-nav-sm hover-color-grey" target="_self" data-hfjs="InstrumentedAnchor" data-type="click_navAccount" data-path="myAccount:my events">My Events</a></li><li><a href="https://www.nike.com/member/settings" role="option" aria-selected="false" class="fs12-nav-sm hover-color-grey" target="_self" data-hfjs="InstrumentedAnchor" data-type="click_navAccount" data-path="myAccount:account settings">Account Settings</a></li><li><button role="option" aria-selected="false" class="nav-btn p0-sm fs12-nav-sm hover-color-grey" target="_self" data-hfjs="InstrumentedAnchor" data-type="click_navAccount" data-path="myAccount:log out">Log Out</button></li></ul></div></div></div></li>

Not sure is this what you mean?

alexschimpf commented 5 years ago

Ok so it looks like Nike has changed their site up since the script was written. I'll have to make some changes in order for it to work again.

sherryhw commented 5 years ago

I am using Firefox on Mac, when I right click that join/login to inspect, and then I copy the

alexschimpf commented 4 years ago

Looks like there is a PR out for this fix: #18