Hi,
Ich wollte gerade mal Selenium zum Webscrappen austesten. Nun bekomme ich eine Exception
Der Chrome Linux Driver den ich unter https://chromedriver.storage.googleapis.com/index.html?path=97.0.4692.36/ heruntergeladen habe liegt im resources Folder meines Projekts.
OS ist Fedora
[CODE title="Stacktrace"]SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Starting ChromeDriver 97.0.4692.36 (747e0a0f19c13ca6ee136200f5b097448ae4892f-refs/branch-heads/4692@{#607}) on port 59692
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: cannot find Chrome binary
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: 'fedora', ip: '192.168.178.68', os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.11-200.fc35.x86_64', java.version: '17.0.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}], desiredCapabilities=Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}}]
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:62)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:167)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:142)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:230)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:151)
at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:108)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:104)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:91)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:46)
at net.imarco.Main.main(Main.java:9)
Process finished with exit code 1
[/CODE]
Ich wollte gerade mal Selenium zum Webscrappen austesten. Nun bekomme ich eine Exception
Der Chrome Linux Driver den ich unter https://chromedriver.storage.googleapis.com/index.html?path=97.0.4692.36/ heruntergeladen habe liegt im resources Folder meines Projekts.
OS ist Fedora
Java:
import org.openqa.selenium.chrome.ChromeDriver;
public class Main {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "/home/marco/Repositories/test/src/main/resources/chromedriver");
ChromeDriver chromeDriver = new ChromeDriver();
}
}
[CODE title="Stacktrace"]SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Starting ChromeDriver 97.0.4692.36 (747e0a0f19c13ca6ee136200f5b097448ae4892f-refs/branch-heads/4692@{#607}) on port 59692
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: cannot find Chrome binary
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: 'fedora', ip: '192.168.178.68', os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.11-200.fc35.x86_64', java.version: '17.0.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}], desiredCapabilities=Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}}]
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:62)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:167)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:142)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:230)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:151)
at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:108)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:104)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:91)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:46)
at net.imarco.Main.main(Main.java:9)
Process finished with exit code 1
[/CODE]