C#
セレンを使用してプログラムを作成しました。Windows で使用する場合は問題なく動作しますが、Rapsberry Pi では動作しません。[セレンの部分がなくても動作します]。
コードは次のとおりです。
var options = new FirefoxOptions();
options.BrowserExecutableLocation = @"C:\Program Files (x86)\Mozilla Firefox\firefox.exe";
//IWebDriver driver = new FirefoxDriver(options); // WINDOWS VERSION
IWebDriver driver = new FirefoxDriver(); // LINUX VERSION
string xpath = "html/body/div[1]/div/main/div/section/section[2]/div/div[2]/div[1]/div/div/textarea";
string xpathButton = "html/body/div[1]/div/main/div/section/section[2]/div/div[2]/div[1]/div/button";
driver.Url = myurl;
driver.FindElement(By.XPath(xpathButton)).Click();
List<IWebElement> webElems = driver.FindElements(By.XPath(xpath)).ToList();
string comparestring = "";
int comparecounter = 0;
foreach (IWebElement element in webElems)
{
comparestring = element.Text;
}
ラズベリーパイで次のエラーが発生し続けます:
接続拒否
および: OpenQA.Selenium.WebDriverException: Unable to find the matching set of capabilities at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError (OpenQA.Selenium.Remote.Remote.Response errorResponse) [0x00000] in :0 at OpenQA.Selenium.Remote.RemoteWebDriver .Execute (System.String driverCommandToExecute, System.Collections.Generic.Dictionary`2 parameters) [0x00000] in :0 at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession (ICapabilities desiredCapabilities) [0x00000] in :0 at OpenQA.Selenium. Remote.RemoteWebDriver..ctor (ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) [0x00000] in :0 at OpenQA.Selenium.Firefox.FirefoxDriver..ctor (OpenQA.Selenium.Firefox.FirefoxDriverService サービス、OpenQA.Selenium.Firefox.FirefoxOptions オプション、TimeSpan commandTimeout) [0x00000] in :0 at OpenQA.Selenium.Firefox.FirefoxDriver..ctor (OpenQA.Selenium.Firefox.FirefoxOptions オプション) [0x00000] in :0 at OpenQA.Selenium.Firefox.FirefoxDriver..ctor () [0x00000] in :0 at Dialga.MyBot+c__async8.MoveNext () [ 0x00000] in :0