【发布时间】:2020-05-07 17:54:47
【问题描述】:
我曾尝试单击最后一个按钮以使用 Selenium 查看分数,但它不起作用。我尝试使用 CSSselector。有什么想法会起作用吗?
![1]:https://i.stack.imgur.com/NZ90V.png
try
{
var reee = driver.FindElement(By.CssSelector("body > div.freebirdFormviewerViewFormContentWrapper > div:nth-child(2) > div.freebirdFormviewerViewFormCard.exportFormCard > div > div.freebirdFormviewerViewResponseLinksContainer > div > a > span"));
Actions actions = new Actions(driver);
actions.MoveToElement(reee);
Thread.Sleep(2000);
actions.Click();
actions.Build().Perform();
}
catch
{
Console.WriteLine("well not working");
}
(它适用于提交按钮顺便说一句) (放轻松,我 15 岁)
【问题讨论】:
-
你能显示按钮的 html 标记吗?
-
<span jsslot="" class="appsMaterialWizButtonPaperbuttonContent exportButtonContent"><span class="appsMaterialWizButtonPaperbuttonLabel quantumWizButtonPaperbuttonLabel exportLabel">Преглед на оценката</span></span>@Dazed
标签: c# selenium-webdriver selenium-firefoxdriver