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

TypeError: init() got an unexpected keyword argument 'options' #121

Closed
shanow7 opened this issue Oct 20, 2020 · 13 comments
Closed

TypeError: init() got an unexpected keyword argument 'options' #121

shanow7 opened this issue Oct 20, 2020 · 13 comments

Comments

@shanow7
Copy link

shanow7 commented Oct 20, 2020

GHunt$ sudo python3 check_and_gen.py
[-] No stored cookies found

Enter these browser cookies found at accounts.google.com :
_Secure-3PSID => 2gfQYh2qGqQzMbOYH-vdik8MeFcTOrBgJ_xdmGXd1WZs
APISID => qKMvZCwrVnExLNVsPYY5Yav2d
SAPISID => DCVQhAXmgc-YgqvSFq8hiZKt
HSID => ArJEblPhvcg1a

[+] The cookies seems valid! Generating the Google Docs and Hangouts token...

Google Docs Token => AC4w5ViFnxm5Wvoafbu_jhoSg:160313810
Traceback (most recent call last):
File "check_and_gen.py", line 126, in
auth_token, hangouts_token = get_hangouts_tokens(cookies, driverpath)
File "check_and_gen.py", line 61, in get_hangouts_tokens
driver = webdriver.Chrome(
File "/usr/local/lib/python3.8/dist-packages/seleniumwire/webdriver/browser.py", line 86, in init
super().init(*args, **kwargs)
TypeError: init() got an unexpected keyword argument 'options'

can you help?

@mxrch
Copy link
Owner

mxrch commented Oct 24, 2020

@shanow7 did you well installed the requirements.txt with the same Python version you are using with GHunt ?

@mxrch
Copy link
Owner

mxrch commented Oct 24, 2020

Antxine, Can you run it without sudo ?

@Antxine
Copy link

Antxine commented Oct 24, 2020

Antxine, Can you run it without sudo ?

I don't run it with sudo

Moreover, I run requirements.txt and check_and_gen.py with python3.

$ python3 -V
Python 3.8.6

@mxrch
Copy link
Owner

mxrch commented Oct 24, 2020

@Antxine Can you paste the full output of the requirements installation here ?

@mxrch mxrch changed the title No stored cookies found TypeError: init() got an unexpected keyword argument 'options' Oct 24, 2020
@Antxine
Copy link

Antxine commented Oct 24, 2020

@Antxine Can you paste the full output of the requirements installation here ?

$ python3 -m pip install -r requirements.txt
Requirement already satisfied: geopy in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 1)) (2.0.0)
Requirement already satisfied: httpx in /home/osint/.local/lib/python3.8/site-packages (from -r requirements.txt (line 2)) (0.16.1)
Requirement already satisfied: selenium-wire in /home/osint/.local/lib/python3.8/site-packages (from -r requirements.txt (line 3)) (2.1.1)
Requirement already satisfied: selenium in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 4)) (2.53.6)
Requirement already satisfied: imagehash in /home/osint/.local/lib/python3.8/site-packages (from -r requirements.txt (line 5)) (4.1.0)
Requirement already satisfied: pillow in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 6)) (7.2.0)
Requirement already satisfied: python-dateutil in /usr/lib/python3/dist-packages (from -r requirements.txt (line 7)) (2.8.1)
Requirement already satisfied: colorama in /usr/lib/python3/dist-packages (from -r requirements.txt (line 8)) (0.4.3)
Requirement already satisfied: chromedriver-autoinstaller in /home/osint/.local/lib/python3.8/site-packages (from -r requirements.txt (line 9)) (0.2.2)
Requirement already satisfied: beautifultable in /home/osint/.local/lib/python3.8/site-packages (from -r requirements.txt (line 10)) (1.0.0)
Requirement already satisfied: termcolor in /usr/local/lib/python3.8/dist-packages (from -r requirements.txt (line 11)) (1.1.0)
Requirement already satisfied: geographiclib<2,>=1.49 in /usr/local/lib/python3.8/dist-packages (from geopy->-r requirements.txt (line 1)) (1.50)
Requirement already satisfied: httpcore==0.12.* in /home/osint/.local/lib/python3.8/site-packages (from httpx->-r requirements.txt (line 2)) (0.12.0)
Requirement already satisfied: certifi in /usr/lib/python3/dist-packages (from httpx->-r requirements.txt (line 2)) (2020.6.20)
Requirement already satisfied: rfc3986[idna2008]<2,>=1.3 in /home/osint/.local/lib/python3.8/site-packages (from httpx->-r requirements.txt (line 2)) (1.4.0)
Requirement already satisfied: sniffio in /home/osint/.local/lib/python3.8/site-packages (from httpx->-r requirements.txt (line 2)) (1.2.0)
Requirement already satisfied: PyWavelets in /home/osint/.local/lib/python3.8/site-packages (from imagehash->-r requirements.txt (line 5)) (1.1.1)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from imagehash->-r requirements.txt (line 5)) (1.15.0)
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from imagehash->-r requirements.txt (line 5)) (1.19.2)
Requirement already satisfied: scipy in /usr/lib/python3/dist-packages (from imagehash->-r requirements.txt (line 5)) (1.5.2)
Requirement already satisfied: wcwidth in /usr/local/lib/python3.8/dist-packages/wcwidth-0.2.5-py3.8.egg (from beautifultable->-r requirements.txt (line 10)) (0.2.5)
Requirement already satisfied: h11==0.* in /home/osint/.local/lib/python3.8/site-packages (from httpcore==0.12.*->httpx->-r requirements.txt (line 2)) (0.11.0)
Requirement already satisfied: idna; extra == "idna2008" in /usr/lib/python3/dist-packages (from rfc3986[idna2008]<2,>=1.3->httpx->-r requirements.txt (line 2)) (2.10)

@mxrch
Copy link
Owner

mxrch commented Oct 24, 2020

Hm very weird. I'll investigate

@mxrch
Copy link
Owner

mxrch commented Oct 24, 2020

https://github.com/SeleniumHQ/selenium/blob/63dd8b9a5af6d3d8daac997cb38872a439f24280/py/selenium/webdriver/chrome/webdriver.py#L35
The options should be there but I think it's getting replaced by chrome_options.
Replacing the keyword arg options by chrome_options did not throw error for me so I'm pushing the changes.

mxrch added a commit that referenced this issue Oct 24, 2020
@mxrch
Copy link
Owner

mxrch commented Oct 24, 2020

Changes pushed in 664db94, @Antxine @shanow7 does it fix your error ?

@Antxine
Copy link

Antxine commented Oct 24, 2020

Changes pushed in 664db94, @Antxine @shanow7 does it fix your error ?
I got this error

Traceback (most recent call last):
File "check_and_gen.py", line 159, in
auth_token, hangouts_token = get_hangouts_tokens(cookies, driverpath)
File "check_and_gen.py", line 68, in get_hangouts_tokens
driver = webdriver.Chrome(
File "/home/osint/.local/lib/python3.8/site-packages/seleniumwire/webdriver/browser.py", line 86, in init
super().init(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/chrome/webdriver.py", line 65, in init
RemoteWebDriver.init(
File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/webdriver.py", line 90, in init
self.start_session(desired_capabilities, browser_profile)
File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/webdriver.py", line 177, in start_session
response = self.execute(Command.NEW_SESSION, capabilities)
File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: session not created: This version of ChromeDriver only supports Chrome version 83
(Driver info: chromedriver=83.0.4103.116 (8f0c18b4dca9b6699eb629be0f51810c24fb6428-refs/branch-heads/4103@{#716}),platform=Linux 5.8.0-kali3-amd64 x86_64)

@mxrch
Copy link
Owner

mxrch commented Oct 24, 2020

@Antxine

  1. What is your Google Chrome version ?
  2. Did you download the chrome driver manually ?

@Antxine
Copy link

Antxine commented Oct 25, 2020

@Antxine

  1. What is your Google Chrome version ?
  2. Did you download the chrome driver manually ?

Google Chrome is version 86.0.4240.111 and I did not install Chromedriver manually.

@mxrch
Copy link
Owner

mxrch commented Oct 25, 2020

@Antxine Alright, weird that it auto installed the wrong version, maybe you have Chromium installed too or idk.
Try to download the chromedriver version 86 and put it in the GHunt directory, and delete the folder "83" if you have it, or another number where the auto installed chromedriver is
And then you can retry

@Antxine
Copy link

Antxine commented Oct 25, 2020

@Antxine Alright, weird that it auto installed the wrong version, maybe you have Chromium installed too or idk.
Try to download the chromedriver version 86 and put it in the GHunt directory, and delete the folder "83" if you have it, or another number where the auto installed chromedriver is
And then you can retry

I confirm that I also have Chromium.
I manually downloaded Chromedriver for version 86 and put it in GHunt/ and it works now!

@mxrch mxrch closed this as completed Oct 25, 2020
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

3 participants