基本上我想知道的是如何将一些HTML文本读入标签(我将其从网站中截取出来),但我知道我无法将Web元素转换为串。任何帮助?将Html文本读入标签
顺便说一句。我对C#很陌生。
var points = driver.FindElement(By.CssSelector("#site-header > div > div > div.col-xs-8.col-sm-8.col-md-8 > div > div.header-right.header-user-functions > div:nth-child(5) > a > span"));
CustomLabel7.Text = points;
你在 '点',现在得到的Text属性? – A3006
你试过了吗:driver.FindElement(By.CssSelector(“#site-header> div> div> div.col-xs-8.col-sm-8.col-md-8> div> div.header-right .header-user-functions> div:nth-child(5)> a> span“))。toString(); ? –
@ A3006我得到“不能隐式地将类型'OpenQA.Selenium.IWebElement'转换为'sting'” –