error while executing python scripts with selenium
I have installed python, pip and selenium in my system and I'm testing a sample code on basic sites.
Code:
from selenium import webdriver
import time
driver = webdriver.Chrome("C:\Users\skandregula\PycharmProjects\sele\geckodriver.exe")
driver.get("http://www.python.org")
time.sleep(10)
driver.close()
error:C:UsersskandregulaPycharmProjectsselevenvScriptspython.exe
C:/Users/skandregula/PycharmProjects/sele/script.py Traceback (most
recent call last): File
"C:/Users/skandregula/PycharmProjects/sele/script.py", line 5, in
<module>
driver = webdriver.Chrome("C:\Users\skandregula\PycharmProjects\sele\geckodriver.exe")
File
"C:UsersskandregulaPycharmProjectsselevenvlibsite-packagesseleniumwebdriverchromewebdriver.py",
line 81, in __init__
desired_capabilities=desired_capabilities) File "C:UsersskandregulaPycharmProjectsselevenvlibsite-packagesseleniumwebdriverremotewebdriver.py",
line 157, in __init__
self.start_session(capabilities, browser_profile) File "C:UsersskandregulaPycharmProjectsselevenvlibsite-packagesseleniumwebdriverremotewebdriver.py",
line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters) File "C:UsersskandregulaPycharmProjectsselevenvlibsite-packagesseleniumwebdriverremotewebdriver.py",
line 321, in execute
self.error_handler.check_response(response) File "C:UsersskandregulaPycharmProjectsselevenvlibsite-packagesseleniumwebdriverremoteerrorhandler.py",
line 242, in check_response
raise exception_class(message, screen, stacktrace) selenium.common.exceptions.SessionNotCreatedException: Message: Unable
to find a matching set of capabilities
How to resolve this issue?
python selenium selenium-webdriver selenium-chromedriver
|
show 3 more comments
I have installed python, pip and selenium in my system and I'm testing a sample code on basic sites.
Code:
from selenium import webdriver
import time
driver = webdriver.Chrome("C:\Users\skandregula\PycharmProjects\sele\geckodriver.exe")
driver.get("http://www.python.org")
time.sleep(10)
driver.close()
error:C:UsersskandregulaPycharmProjectsselevenvScriptspython.exe
C:/Users/skandregula/PycharmProjects/sele/script.py Traceback (most
recent call last): File
"C:/Users/skandregula/PycharmProjects/sele/script.py", line 5, in
<module>
driver = webdriver.Chrome("C:\Users\skandregula\PycharmProjects\sele\geckodriver.exe")
File
"C:UsersskandregulaPycharmProjectsselevenvlibsite-packagesseleniumwebdriverchromewebdriver.py",
line 81, in __init__
desired_capabilities=desired_capabilities) File "C:UsersskandregulaPycharmProjectsselevenvlibsite-packagesseleniumwebdriverremotewebdriver.py",
line 157, in __init__
self.start_session(capabilities, browser_profile) File "C:UsersskandregulaPycharmProjectsselevenvlibsite-packagesseleniumwebdriverremotewebdriver.py",
line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters) File "C:UsersskandregulaPycharmProjectsselevenvlibsite-packagesseleniumwebdriverremotewebdriver.py",
line 321, in execute
self.error_handler.check_response(response) File "C:UsersskandregulaPycharmProjectsselevenvlibsite-packagesseleniumwebdriverremoteerrorhandler.py",
line 242, in check_response
raise exception_class(message, screen, stacktrace) selenium.common.exceptions.SessionNotCreatedException: Message: Unable
to find a matching set of capabilities
How to resolve this issue?
python selenium selenium-webdriver selenium-chromedriver
1
Possible duplicate of Selenium "Unable to find a matching set of capabilities" despite driver being in /usr/local/bin
– G. Anderson
Nov 13 '18 at 16:48
Try passing the path in the keyword argumentexecutable_path
– asheets
Nov 13 '18 at 17:07
i did use executable_path, but the error is at webdriver
– sindhuri
Nov 13 '18 at 19:18
how can install webdriver
– sindhuri
Nov 13 '18 at 19:18
selenium is installed
– sindhuri
Nov 13 '18 at 19:18
|
show 3 more comments
I have installed python, pip and selenium in my system and I'm testing a sample code on basic sites.
Code:
from selenium import webdriver
import time
driver = webdriver.Chrome("C:\Users\skandregula\PycharmProjects\sele\geckodriver.exe")
driver.get("http://www.python.org")
time.sleep(10)
driver.close()
error:C:UsersskandregulaPycharmProjectsselevenvScriptspython.exe
C:/Users/skandregula/PycharmProjects/sele/script.py Traceback (most
recent call last): File
"C:/Users/skandregula/PycharmProjects/sele/script.py", line 5, in
<module>
driver = webdriver.Chrome("C:\Users\skandregula\PycharmProjects\sele\geckodriver.exe")
File
"C:UsersskandregulaPycharmProjectsselevenvlibsite-packagesseleniumwebdriverchromewebdriver.py",
line 81, in __init__
desired_capabilities=desired_capabilities) File "C:UsersskandregulaPycharmProjectsselevenvlibsite-packagesseleniumwebdriverremotewebdriver.py",
line 157, in __init__
self.start_session(capabilities, browser_profile) File "C:UsersskandregulaPycharmProjectsselevenvlibsite-packagesseleniumwebdriverremotewebdriver.py",
line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters) File "C:UsersskandregulaPycharmProjectsselevenvlibsite-packagesseleniumwebdriverremotewebdriver.py",
line 321, in execute
self.error_handler.check_response(response) File "C:UsersskandregulaPycharmProjectsselevenvlibsite-packagesseleniumwebdriverremoteerrorhandler.py",
line 242, in check_response
raise exception_class(message, screen, stacktrace) selenium.common.exceptions.SessionNotCreatedException: Message: Unable
to find a matching set of capabilities
How to resolve this issue?
python selenium selenium-webdriver selenium-chromedriver
I have installed python, pip and selenium in my system and I'm testing a sample code on basic sites.
Code:
from selenium import webdriver
import time
driver = webdriver.Chrome("C:\Users\skandregula\PycharmProjects\sele\geckodriver.exe")
driver.get("http://www.python.org")
time.sleep(10)
driver.close()
error:C:UsersskandregulaPycharmProjectsselevenvScriptspython.exe
C:/Users/skandregula/PycharmProjects/sele/script.py Traceback (most
recent call last): File
"C:/Users/skandregula/PycharmProjects/sele/script.py", line 5, in
<module>
driver = webdriver.Chrome("C:\Users\skandregula\PycharmProjects\sele\geckodriver.exe")
File
"C:UsersskandregulaPycharmProjectsselevenvlibsite-packagesseleniumwebdriverchromewebdriver.py",
line 81, in __init__
desired_capabilities=desired_capabilities) File "C:UsersskandregulaPycharmProjectsselevenvlibsite-packagesseleniumwebdriverremotewebdriver.py",
line 157, in __init__
self.start_session(capabilities, browser_profile) File "C:UsersskandregulaPycharmProjectsselevenvlibsite-packagesseleniumwebdriverremotewebdriver.py",
line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters) File "C:UsersskandregulaPycharmProjectsselevenvlibsite-packagesseleniumwebdriverremotewebdriver.py",
line 321, in execute
self.error_handler.check_response(response) File "C:UsersskandregulaPycharmProjectsselevenvlibsite-packagesseleniumwebdriverremoteerrorhandler.py",
line 242, in check_response
raise exception_class(message, screen, stacktrace) selenium.common.exceptions.SessionNotCreatedException: Message: Unable
to find a matching set of capabilities
How to resolve this issue?
python selenium selenium-webdriver selenium-chromedriver
python selenium selenium-webdriver selenium-chromedriver
edited Nov 13 '18 at 20:34
Alois Mahdal
5,23244061
5,23244061
asked Nov 13 '18 at 16:44
sindhurisindhuri
11
11
1
Possible duplicate of Selenium "Unable to find a matching set of capabilities" despite driver being in /usr/local/bin
– G. Anderson
Nov 13 '18 at 16:48
Try passing the path in the keyword argumentexecutable_path
– asheets
Nov 13 '18 at 17:07
i did use executable_path, but the error is at webdriver
– sindhuri
Nov 13 '18 at 19:18
how can install webdriver
– sindhuri
Nov 13 '18 at 19:18
selenium is installed
– sindhuri
Nov 13 '18 at 19:18
|
show 3 more comments
1
Possible duplicate of Selenium "Unable to find a matching set of capabilities" despite driver being in /usr/local/bin
– G. Anderson
Nov 13 '18 at 16:48
Try passing the path in the keyword argumentexecutable_path
– asheets
Nov 13 '18 at 17:07
i did use executable_path, but the error is at webdriver
– sindhuri
Nov 13 '18 at 19:18
how can install webdriver
– sindhuri
Nov 13 '18 at 19:18
selenium is installed
– sindhuri
Nov 13 '18 at 19:18
1
1
Possible duplicate of Selenium "Unable to find a matching set of capabilities" despite driver being in /usr/local/bin
– G. Anderson
Nov 13 '18 at 16:48
Possible duplicate of Selenium "Unable to find a matching set of capabilities" despite driver being in /usr/local/bin
– G. Anderson
Nov 13 '18 at 16:48
Try passing the path in the keyword argument
executable_path
– asheets
Nov 13 '18 at 17:07
Try passing the path in the keyword argument
executable_path
– asheets
Nov 13 '18 at 17:07
i did use executable_path, but the error is at webdriver
– sindhuri
Nov 13 '18 at 19:18
i did use executable_path, but the error is at webdriver
– sindhuri
Nov 13 '18 at 19:18
how can install webdriver
– sindhuri
Nov 13 '18 at 19:18
how can install webdriver
– sindhuri
Nov 13 '18 at 19:18
selenium is installed
– sindhuri
Nov 13 '18 at 19:18
selenium is installed
– sindhuri
Nov 13 '18 at 19:18
|
show 3 more comments
1 Answer
1
active
oldest
votes
driver = webdriver.Chrome("C:\Users\skandregula\PycharmProjects\sele\geckodriver.exe")
this line is attempting to launch an instance of a Chrome browser, but you are passing it the path to geckodriver.exe
, which is the Webdriver for Firefox. You need to use chromedriver.exe
for Chrome.
This should nail the OP !!!
– DebanjanB
Nov 14 '18 at 7:34
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53285739%2ferror-while-executing-python-scripts-with-selenium%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
driver = webdriver.Chrome("C:\Users\skandregula\PycharmProjects\sele\geckodriver.exe")
this line is attempting to launch an instance of a Chrome browser, but you are passing it the path to geckodriver.exe
, which is the Webdriver for Firefox. You need to use chromedriver.exe
for Chrome.
This should nail the OP !!!
– DebanjanB
Nov 14 '18 at 7:34
add a comment |
driver = webdriver.Chrome("C:\Users\skandregula\PycharmProjects\sele\geckodriver.exe")
this line is attempting to launch an instance of a Chrome browser, but you are passing it the path to geckodriver.exe
, which is the Webdriver for Firefox. You need to use chromedriver.exe
for Chrome.
This should nail the OP !!!
– DebanjanB
Nov 14 '18 at 7:34
add a comment |
driver = webdriver.Chrome("C:\Users\skandregula\PycharmProjects\sele\geckodriver.exe")
this line is attempting to launch an instance of a Chrome browser, but you are passing it the path to geckodriver.exe
, which is the Webdriver for Firefox. You need to use chromedriver.exe
for Chrome.
driver = webdriver.Chrome("C:\Users\skandregula\PycharmProjects\sele\geckodriver.exe")
this line is attempting to launch an instance of a Chrome browser, but you are passing it the path to geckodriver.exe
, which is the Webdriver for Firefox. You need to use chromedriver.exe
for Chrome.
answered Nov 13 '18 at 22:42
Corey GoldbergCorey Goldberg
37.1k22108123
37.1k22108123
This should nail the OP !!!
– DebanjanB
Nov 14 '18 at 7:34
add a comment |
This should nail the OP !!!
– DebanjanB
Nov 14 '18 at 7:34
This should nail the OP !!!
– DebanjanB
Nov 14 '18 at 7:34
This should nail the OP !!!
– DebanjanB
Nov 14 '18 at 7:34
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53285739%2ferror-while-executing-python-scripts-with-selenium%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Possible duplicate of Selenium "Unable to find a matching set of capabilities" despite driver being in /usr/local/bin
– G. Anderson
Nov 13 '18 at 16:48
Try passing the path in the keyword argument
executable_path
– asheets
Nov 13 '18 at 17:07
i did use executable_path, but the error is at webdriver
– sindhuri
Nov 13 '18 at 19:18
how can install webdriver
– sindhuri
Nov 13 '18 at 19:18
selenium is installed
– sindhuri
Nov 13 '18 at 19:18