Maxence-L / okcupidon

A python web scraper built on Selenium to gather profile data from okcupid.com
MIT License
12 stars 12 forks source link

Selenium error on login (element not clickable at point), crashes #4

Open orazdow opened 2 years ago

orazdow commented 2 years ago

The scraper crashes upon logging in, I'm getting both an error about cookies and a Selenium error, which sounds like the issue. OUTPUT:

me@me:~/Documents/ok/okcupidon$ python3 -m okcupidon run
A database was found in /home/me/Documents/ok/okcupidon/okc_db
No usuable cookies were found. Please try entering your id info (id, pwd)
You provided and email and a password which will be used for logging in
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/me/Documents/ok/okcupidon/okcupidon/__main__.py", line 207, in <module>
    main()
  File "/home/me/Documents/ok/okcupidon/okcupidon/__main__.py", line 128, in main
    my_scrapper.log_to_ok_cupid(id=id, pwd=pwd, save_cookies=store_cookies)
  File "/home/me/Documents/ok/okcupidon/okcupidon/webship.py", line 165, in log_to_ok_cupid
    __two_fa_login(id=id, pwd=pwd, save_cookies=save_cookies)
  File "/home/me/Documents/ok/okcupidon/okcupidon/webship.py", line 103, in __two_fa_login
    self.driver.find_element_by_class_name("login-actions-button").click()
  File "/home/me/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webelement.py", line 89, in click
    self._execute(Command.CLICK_ELEMENT)
  File "/home/me/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webelement.py", line 773, in _execute
    return self._parent.execute(command, params)
  File "/home/me/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 430, in execute
    self.error_handler.check_response(response)
  File "/home/me/.local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element <button type="submit" class="login-actions-button" data-cy="login.submitButton">...</button> is not clickable at point (495, 459). Other element would receive the click: <p id="onetrust-policy-text">...</p>
  (Session info: chrome=103.0.5060.53)
Maxence-L commented 1 year ago

OkCupid must have been changing their UI, which crashes the script as it can't find the button.