Reputation: 11
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
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
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
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
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
Reputation: 49
Specify the path the chrome driver is located in for example when calling
webdriver.Firefox(‘C://Users/Username/Downloads/‘)
Upvotes: 2
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