Ram Kaatiya
Ram Kaatiya

Reputation: 11

TypeError: get() missing 1 required positional argument: 'url' error using GeckoDriver and Firefox

Executing below code in pycharm.

from selenium import webdriver
browser = webdriver.Firefox
browser.get('https://www.google.com')

Error:

TypeError: get() missing 1 required positional argument: 'url'

How can I solve the error?

Upvotes: 0

Views: 27121

Answers (6)

Ronald Escobar
Ronald Escobar

Reputation: 1

The issue is caused bacause there are not,()pharentesis, put the pharantesis end to the line

Check this In Selenium and python driver = webdriver.Chrome()

Upvotes: 0

MD SHAYON
MD SHAYON

Reputation: 8063

In my case, I got this error for not using parenthesis ().

from selenium import webdriver
browser = webdriver.Firefox()
browser.get('https://www.google.com')

Upvotes: 1

undetected Selenium
undetected Selenium

Reputation: 193178

The constructor is driver = webdriver.Firefox(). So in your code block you need to replace driver = webdriver.Firefox with:

driver = webdriver.Firefox()

Additionally, you may need to pass the absolute path of the GeckoDriver binary as follows:

driver = webdriver.Firefox(executable_path=r'C:\path\to\geckodriver.exe')

Upvotes: 0

Rishabh Verma
Rishabh Verma

Reputation: 21

This worked for me:

from selenium import webdriver
driver = webdriver.Chrome("C:\\Users\Rishabh\Downloads\chromedriver_win32\chromedriver.exe")
driver.get('https://web.whatsapp.com/')

Alternate code:

from selenium import webdriver
driver = webdriver.Chrome(executable_path="C:\\Users\Rishabh\Downloads\chromedriver_win32\chromedriver.exe")
driver.get('https://web.whatsapp.com/')

Upvotes: 2

nathan Heath
nathan Heath

Reputation: 49

Specify the path the chrome driver is located in for example when calling

webdriver.Firefox(‘C://Users/Username/Downloads/‘) 

Upvotes: 2

Chandella07
Chandella07

Reputation: 2117

Try with braces while creating Firefox instance. see below example.

from selenium import webdriver
browser = webdriver.Firefox()   #focus on () at the end
browser.get('https://www.google.com')

Upvotes: 0

Related Questions