Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thebluecrusader opened this issue Oct 14, 2023 · 20 comments
Open

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

thebluecrusader opened this issue Oct 14, 2023 · 20 comments

Comments

@thebluecrusader
Copy link

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>

@Elektrozeugs
Copy link

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.

@thebluecrusader
Copy link
Author

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.

@Lowell130
Copy link

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
Copy link

Solved turn back to selenium==4.8.3

@thebluecrusader
Copy link
Author

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.

@kspyy
Copy link

kspyy commented Oct 26, 2023

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

@Lowell130
Copy link

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))
^^^^^^^^^^^^

@Elektrozeugs
Copy link

Elektrozeugs commented Nov 2, 2023

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 :)

@thebluecrusader
Copy link
Author

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?

@Lowell130
Copy link

Until a few days ago everything was working perfectly

@Lowell130
Copy link

Surely the problem is related to the latest version of chrome

@Lowell130
Copy link

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
Copy link

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

@thebluecrusader
Copy link
Author

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

@Lowell130
Copy link

not work

@Elektrozeugs
Copy link

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

@thebluecrusader
Copy link
Author

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

@Lowell130
Copy link

3.8.6

after uninstall Selenium: 4.12 and reinstall it, not work

@Elektrozeugs
Copy link

Elektrozeugs commented Nov 16, 2023

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.

@Shimoli
Copy link

Shimoli commented Dec 11, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants