【发布时间】:2020-11-11 11:45:51
【问题描述】:
我在 CS 中使用 chromedriver 使用 css 选择器查找元素但是我收到以下错误:
OpenQA.Selenium.InvalidSelectorException: 'invalid selector: An invalid or illegal selector was specified
我的代码:
var body = driver.FindElementsByCssSelector(".add-to-cart.float-right.font-montserratSemiBold.text-11.lg:text-12.text-secondary.flex.flex-wrap.leading-articlesmall");
我正在尝试在this website 上找到Add to basket 按钮的元素
我的选择器出了什么问题,我该如何解决这个问题?
【问题讨论】:
标签: c# selenium xpath css-selectors invalidselectorexception