Picture of the screen it stays on forever:
I am having trouble getting Selenium to login to Costco.com. It basically freezes at the login screen and won't proceed to the next screen.
from selenium import webdriver;
from selenium.webdriver.support.ui import Select;
from selenium.webdriver.common.keys import Keys;
from selenium.webdriver.common.by import By;
import time;
browser = webdriver.Chrome()
browser.get('https://www.costcobusinessdelivery.com/LogonForm?URL=%2f')
email = browser.find_element_by_css_selector('#logonId')
email.click()
email.send_keys('my_email')
password = browser.find_element_by_css_selector('#logonPassword_id')
password.click()
password.send_keys('my_password')
zipcode = browser.find_element_by_css_selector('#deliveryZipCode')
zipcode.click()
zipcode.send_keys('my_zipcode')
login = browser.find_element_by_css_selector('#sign_in_button')
login.click()
After a few minutes of Selenium sitting there it then pops out the traceback. I've tried using beautifulsoup4 to login and pass the data back to Selenium but I 'm not sure if this works. So I first have to navigate to the page I need in Selenium then parse the data with BS4.
TimeoutException Traceback (most recent call last)
<ipython-input-80-ddf2d5259794> in <module>
1 login = browser.find_element_by_css_selector('#sign_in_button')
----> 2 login.click()
C:\ProgramData\Anaconda\lib\site-packages\selenium\webdriver\remote\webelement.py in click(self)
78 def click(self):
79 """Clicks the element."""
---> 80 self._execute(Command.CLICK_ELEMENT)
81
82 def submit(self):
C:\ProgramData\Anaconda\lib\site-packages\selenium\webdriver\remote\webelement.py in _execute(self, command, params)
631 params = {}
632 params['id'] = self._id
--> 633 return self._parent.execute(command, params)
634
635 def find_element(self, by=By.ID, value=None):
C:\ProgramData\Anaconda\lib\site-packages\selenium\webdriver\remote\webdriver.py in execute(self, driver_command, params)
319 response = self.command_executor.execute(driver_command, params)
320 if response:
--> 321 self.error_handler.check_response(response)
322 response['value'] = self._unwrap_value(
323 response.get('value', None))
C:\ProgramData\Anaconda\lib\site-packages\selenium\webdriver\remote\errorhandler.py in check_response(self, response)
240 alert_text = value['alert'].get('text')
241 raise exception_class(message, screen, stacktrace, alert_text)
--> 242 raise exception_class(message, screen, stacktrace)
243
244 def _value_or_default(self, obj, key, default):
TimeoutException: Message: timeout
(Session info: chrome=77.0.3865.75)