我尝试从名为 Bidding Ends 的字段返回日期和时间值: 我尝试过其他代码组合,但似乎无法弄清楚
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
namespace WebScraperDemo
{
class Program
{
static void Main(string[] args)
{
IWebDriver driver = new ChromeDriver();
driver.Navigate().GoToUrl("https://www.bidrl.com/auction/autotool-auction-1525-c-street-marysville-ca-september-19th-134834/item/wheel-cover-17686623/");
//this line works
String text1 = driver.FindElement(By.CssSelector("span[ng-bind-html='item.title']")).Text;
System.Diagnostics.Debug.WriteLine(text1);
//dont work
String text2 = driver.FindElement(By.CssSelector("li[ng-if='item.end_time']")).Text;
System.Diagnostics.Debug.WriteLine(text2);
}
}
}