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: 'FirefoxProfile' object has no attribute 'capabilities' #170

Open
orangeyichengyu opened this issue Apr 12, 2024 · 4 comments

Comments

@orangeyichengyu
Copy link

Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/selenium/webdriver/common/driver_finder.py", line 38, in get_path
path = SeleniumManager().driver_location(options) if path is None else path
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/selenium/webdriver/common/selenium_manager.py", line 87, in driver_location
browser = options.capabilities["browserName"]
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'FirefoxProfile' object has no attribute 'capabilities'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/root/EagleEye/eagle-eye.py", line 229, in
main(skipFB=args.skipfb, FBUrls=[], jsonRep=jsonRepFile, dockerMode=aDocker, dockerName=aName)
File "/root/EagleEye/eagle-eye.py", line 99, in main
f.grabData()
File "/root/EagleEye/grabber/facebook.py", line 16, in grabData
driver = cfg.getWebDriver()
^^^^^^^^^^^^^^^^^^
File "/root/EagleEye/utils/config.py", line 45, in getWebDriver
return webdriver.Firefox(profile)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/selenium/webdriver/firefox/webdriver.py", line 59, in init
self.service.path = DriverFinder.get_path(self.service, options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/selenium/webdriver/common/driver_finder.py", line 40, in get_path
msg = f"Unable to obtain driver for {options.capabilities['browserName']} using Selenium Manager."
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'FirefoxProfile' object has no attribute 'capabilities'

@aygupt1822
Copy link

Inside config.py from utils/config.py :-

replace :-
profile = webdriver.FirefoxProfile()

With :-
profile = webdriver.FirefoxOptions()

and then try, maybe it will fix your issue.

@orangeyichengyu
Copy link
Author

Inside config.py from utils/config.py :-

replace :- profile = webdriver.FirefoxProfile()

With :- profile = webdriver.FirefoxOptions()

and then try, maybe it will fix your issue.

Ye it just worked. Thank you so much! In my understanding, it is just a version error right?

@orangeyichengyu
Copy link
Author

Inside config.py from utils/config.py :-

replace :- profile = webdriver.FirefoxProfile()

With :- profile = webdriver.FirefoxOptions()

and then try, maybe it will fix your issue.

Also I got this:
Traceback (most recent call last):
File "/root/EagleEye/eagle-eye.py", line 229, in
main(skipFB=args.skipfb, FBUrls=[], jsonRep=jsonRepFile, dockerMode=aDocker, dockerName=aName)
File "/root/EagleEye/eagle-eye.py", line 99, in main
f.grabData()
File "/root/EagleEye/grabber/facebook.py", line 16, in grabData
driver = cfg.getWebDriver()
^^^^^^^^^^^^^^^^^^
File "/root/EagleEye/utils/config.py", line 45, in getWebDriver
return webdriver.Firefox(profile)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/selenium/webdriver/firefox/webdriver.py", line 69, in init
super().init(command_executor=executor, options=options)
File "/usr/local/lib/python3.11/dist-packages/selenium/webdriver/remote/webdriver.py", line 208, in init
self.start_session(capabilities)
File "/usr/local/lib/python3.11/dist-packages/selenium/webdriver/remote/webdriver.py", line 292, in start_session
response = self.execute(Command.NEW_SESSION, caps)["value"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/selenium/webdriver/remote/webdriver.py", line 347, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.11/dist-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 1

@aygupt1822
Copy link

I honestly gave up on this repo. There have been soo many bugs and errors, they occur in endless loop even after you resolve them.

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

2 participants