Kalebu / alright

Python wrapper for WhatsApp web-based on selenium
https://www.youtube.com/watch?v=yitQTt-NukM
MIT License
376 stars 113 forks source link

Getting error "AttributeError: 'WebDriver' object has no attribute 'find_elements_by_xpath'" #78

Closed badi95 closed 2 years ago

badi95 commented 2 years ago

According to this: https://networkcult.com/fix-attributeerror-webdriver-object-has-no-attribute-find_elements_by_xpath-2190/ Seems like selenium 4.3 has deprecated find_elementby and find_elementsby which breaks alright :(

Kalebu commented 2 years ago

Fixed by #79, please pull the latest code

Kudos to @FedericoCacciari

badi95 commented 2 years ago

Tested with the latest code and it sends messages, but times out and spits out an error

  (Session info: chrome=104.0.5112.79)
Stacktrace:
#0 0x558cc56e8403 <unknown>
#1 0x558cc54ee64b <unknown>
#2 0x558cc5526de7 <unknown>
#3 0x558cc551ae49 <unknown>
#4 0x558cc5543a02 <unknown>
#5 0x558cc551a703 <unknown>
#6 0x558cc5543b0e <unknown>
#7 0x558cc5556c74 <unknown>
#8 0x558cc55438f3 <unknown>
#9 0x558cc55190d8 <unknown>
#10 0x558cc551a205 <unknown>
#11 0x558cc572fe3d <unknown>
#12 0x558cc5732db6 <unknown>
#13 0x558cc571913e <unknown>
#14 0x558cc57339b5 <unknown>
#15 0x558cc570d970 <unknown>
#16 0x558cc5750228 <unknown>
#17 0x558cc57503bf <unknown>
#18 0x558cc576aabe <unknown>
#19 0x7f801c42f609 <unknown>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/alright/__init__.py", line 553, in send_picture
    self.send_attachment()
  File "/usr/local/lib/python3.9/site-packages/alright/__init__.py", line 512, in send_attachment
    sendButton.click()
  File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/remote/webelement.py", line 88, in click
    self._execute(Command.CLICK_ELEMENT)
  File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/remote/webelement.py", line 396, in _execute
    return self._parent.execute(command, params)
  File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 428, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 243, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
  (Session info: chrome=104.0.5112.79)
Stacktrace:
#0 0x558cc56e8403 <unknown>
#1 0x558cc54ee64b <unknown>
#2 0x558cc5526de7 <unknown>
#3 0x558cc551ae49 <unknown>
#4 0x558cc5543a02 <unknown>
#5 0x558cc551a703 <unknown>
#6 0x558cc5543b0e <unknown>
#7 0x558cc5556c74 <unknown>
#8 0x558cc55438f3 <unknown>
#9 0x558cc55190d8 <unknown>
#10 0x558cc551a205 <unknown>
#11 0x558cc572fe3d <unknown>
#12 0x558cc5732db6 <unknown>
#13 0x558cc571913e <unknown>
#14 0x558cc57339b5 <unknown>
#15 0x558cc570d970 <unknown>
#16 0x558cc5750228 <unknown>
#17 0x558cc57503bf <unknown>
#18 0x558cc576aabe <unknown>
#19 0x7f801c42f609 <unknown>

2022-08-25 16:26:46,299 - root -- [INFO] >> send_picture() finished running!