0

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?

6 Answers 6

2

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

webdriver.Firefox(‘C://Users/Username/Downloads/‘) 
Sign up to request clarification or add additional context in comments.

Comments

2

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/')

Comments

1

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

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

Comments

0

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

Comments

0

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

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.