TinderBotz icon indicating copy to clipboard operation
TinderBotz copied to clipboard

AttributeError: 'Session' object has no attribute 'started'

Open thebluecrusader opened this issue 1 year ago • 20 comments

Hi I cant seem to fix this error. It suddenly stopped working, same error on new PC. Here is the full terminal output. Updating my Chrome didnt fix the problem as normal. Here is the specific part maybe thats going wrong: "ValueError: There is no such driver by url https://chromedriver.storage.googleapis.com/LATEST_RELEASE_118.0.5993" I think this shows it cant download the right driver so just doesnt start. Any fixes? Thanks

PS C:\Users\Dean\Documents\TinderBotz-1.6> py quickstart.py C:\Users\Dean\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\chromium\options.py:134: UserWarning: Manipulating w3c setting can have unintended consequences. warnings.warn(UserWarning("Manipulating w3c setting can have unintended consequences.")) Getting ChromeDriver ... Traceback (most recent call last): File "C:\Users\Dean\Documents\TinderBotz-1.6\quickstart.py", line 10, in session = Session() ^^^^^^^^^ File "C:\Users\Dean\Documents\TinderBotz-1.6\tinderbotz\session.py", line 87, in init self.browser = webdriver.Chrome(ChromeDriverManager().install(), options=options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Dean\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\chrome.py", line 39, in install driver_path = self._get_driver_path(self.driver) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Dean\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\core\manager.py", line 30, in _get_driver_path file = self._download_manager.download_file(driver.get_driver_download_url()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Dean\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\drivers\chrome.py", line 40, in get_driver_download_url driver_version_to_download = self.get_driver_version_to_download() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Dean\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\core\driver.py", line 51, in get_driver_version_to_download self._driver_to_download_version = self._version if self._version not in (None, "latest") else self.get_latest_release_version() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Dean\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\drivers\chrome.py", line 62, in get_latest_release_version resp = self._http_client.get(url=latest_release_url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Dean\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\core\http.py", line 37, in get self.validate_response(resp) File "C:\Users\Dean\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\core\http.py", line 16, in validate_response raise ValueError(f"There is no such driver by url {resp.url}") ValueError: There is no such driver by url https://chromedriver.storage.googleapis.com/LATEST_RELEASE_118.0.5993 /==============\

Tinderbotz
duration: 0
like: 0
dislike: 0
superlike: 0
==============/

Exception ignored in atexit callback: <function Session.init..cleanup at 0x0000017CF43F04A0> Traceback (most recent call last): File "C:\Users\Dean\Documents\TinderBotz-1.6\tinderbotz\session.py", line 65, in cleanup print("Started session: {}".format(self.started)) ^^^^^^^^^^^^ AttributeError: 'Session' object has no attribute 'started' PS C:\Users\Dean\Documents\TinderBotz-1.6>

thebluecrusader avatar Oct 14 '23 04:10 thebluecrusader

Hi, could you try it again? I think there was a chromedrive problem with newest Chrome version. I had the same problem yesterday, and searched for it but it seems to work again.

Elektrozeugs avatar Oct 22 '23 20:10 Elektrozeugs

Hi, could you try it again? I think there was a chromedrive problem with newest Chrome version. I had the same problem yesterday, and searched for it but it seems to work again.

Still not working brother. Do you use a 32bit chrome or something? Not sure why it stopped working, I updated Chrome again and no luck.

thebluecrusader avatar Oct 22 '23 21:10 thebluecrusader

Same for me

if headless or options.headless: ^^^^^^^^^^^^^^^^ AttributeError: 'ChromeOptions' object has no attribute 'headless' /==============\

Tinderbotz
duration: 2
like: 0
dislike: 0
superlike: 0
==============/
Exception ignored in atexit callback: <function Session.init..cleanup at 0x000001DC210204A0>

Lowell130 avatar Oct 23 '23 10:10 Lowell130

Solved turn back to selenium==4.8.3

Lowell130 avatar Oct 23 '23 10:10 Lowell130

Solved turn back to selenium==4.8.3

How did you change the selenium version?

Also i think its a different error but let me try it please.

thebluecrusader avatar Oct 23 '23 20:10 thebluecrusader

edit: re-reading it looks like you have a driver error, fwiw i'm using undetected-chromedriver 3.5.2.

I would start searching for that error "There is no such driver by url" https://stackoverflow.com/questions/74011776/valueerror-there-is-no-such-driver-by-url

for the other issue lowell saw, I was also able to resolve it reverting selenium version

Solved turn back to selenium==4.8.3

How did you change the selenium version?

Also i think its a different error but let me try it please.

I found this https://stackoverflow.com/a/77191260

That's a problem due to this change in selenium 4.13.0 that was just released:

* remove deprecated headless methods

I did a

pip uninstall selenium

then

pip install selenium==4.12.0

did the trick for now.

in case it's helpful these are the versions i'm running for each package (on macos) :

selenium                4.12.0
undetected-chromedriver 3.5.2 
webdriver-manager       4.0.0
selenium                4.12.0

kspyy avatar Oct 26 '23 04:10 kspyy

suddenly stopped working

error: Exception ignored in atexit callback: <function Session.init..cleanup at 0x0000027E781804A0> Traceback (most recent call last): File "C:\Users*****\Desktop\python\TinderBotz\tinderbotz\session.py", line 69, in cleanup print("Started session: {}".format(self.started)) ^^^^^^^^^^^^

Lowell130 avatar Nov 02 '23 10:11 Lowell130

I sometimes got this problem when Chrome had an Update / chromedriver update was late or there was an error in an import (selenium for example). When I get this error I normally let chrome search for updates and if that doesnt work I wait for a day or two. Then the magic happens and mostly it works again :)

Elektrozeugs avatar Nov 02 '23 10:11 Elektrozeugs

I sometimes got this problem when Chrome had an Update / chromedriver update was late or there was an error in an import (selenium for example). When I get this error I normally let chrome search for updates and if that doesnt work I wait for a day or two. Then the magic happens and mostly it works again :)

This used to be the case but it doesnt work anymore for me, I think the author abandoned the project and it needs fixing. Unless its working for some of you still?

thebluecrusader avatar Nov 02 '23 10:11 thebluecrusader

Until a few days ago everything was working perfectly

Lowell130 avatar Nov 02 '23 13:11 Lowell130

Surely the problem is related to the latest version of chrome

Lowell130 avatar Nov 04 '23 13:11 Lowell130

Surely the problem is related to the latest version of chrome

in fact this is the error:

selenium.common.exceptions.WebDriverException: Message: unknown error: unable to connect to chrome at 127.0.0.1:57807 from session not created: This version of ChromeDriver only supports Chrome version 114. The current version of the browser is 119.0.6045.106 Stacktrace: Backtrace:

Lowell130 avatar Nov 04 '23 13:11 Lowell130

You need to downgrade Chome to version 114 and everything should be back to working order.

Updating selenium will not help at least until undetected-chromedriver is also updated

Lowell130 avatar Nov 04 '23 14:11 Lowell130

Did anyone get it to work? I still cant get it to work :S

thebluecrusader avatar Nov 10 '23 00:11 thebluecrusader

not work

Lowell130 avatar Nov 12 '23 20:11 Lowell130

Chrome: 119.0.6045.124 Selenium: 4.12 undetected-chromedriver: 3.5.3 webdriver-manager: 3.8.6 Pillow: 9.5.0

works like a charm for me

Elektrozeugs avatar Nov 13 '23 21:11 Elektrozeugs

Chrome: 119.0.6045.124 Selenium: 4.12 undetected-chromedriver: 3.5.3 webdriver-manager: 3.8.6 Pillow: 9.5.0

works like a charm for me

How can i check the versions/change versions for all this stuff? (Other than chrome browser) For example, selenium, UD Chrome driver, webdriver manager, "Pillow" (whatever that is), i want to mirror your versions to see if it fixes it again

thebluecrusader avatar Nov 13 '23 22:11 thebluecrusader

3.8.6

after uninstall Selenium: 4.12 and reinstall it, not work

Lowell130 avatar Nov 15 '23 22:11 Lowell130

Chrome: 119.0.6045.124 Selenium: 4.12 undetected-chromedriver: 3.5.3 webdriver-manager: 3.8.6 Pillow: 9.5.0 works like a charm for me

How can i check the versions/change versions for all this stuff? (Other than chrome browser) For example, selenium, UD Chrome driver, webdriver manager, "Pillow" (whatever that is), i want to mirror your versions to see if it fixes it again

The short answer is using pip: https://packaging.python.org/en/latest/tutorials/installing-packages/ pip uninstall selenium pip install selenium==4.12 It seems you are new into python. It may be helpful if you use Pycharm (or another IDE) to create a virtual environment with the requirements.txt of this project and then select the package versions graphically. Im using Python 3.11 by the way if that helps

edit: @Lowell130 @thebluecrusader A small info that may help. When the error occurs and updates are not helping, try to delete everything in the folder "chrome_profile" and then start the bot again.

Elektrozeugs avatar Nov 16 '23 20:11 Elektrozeugs

Did you guys got the final solution to these error? I am still getting the above errors.

Shimoli avatar Dec 11 '23 12:12 Shimoli