我尝试了在谷歌中找到的任何东西,但所有不能使用
public Form1()
{
InitializeComponent();
}IWebDriver driver;
private void Form1_Load(object sender, EventArgs e)
{
driver = new ChromeDriver();
driver.Navigate().GoToUrl("http://idol.talktv.vn/");
}
private void button1_Click(object sender, EventArgs e)
{
//help me some code
}
<div class="no-login" style="" id="noLoginBox"> <a style="float:left" href="javascript:void(0);"></a><a href="javascript:void(0);" onclick="LoginLogicManagement.showForm();" class="dl"><font><font class="">Đăng nhập </font></font></a> <span style="color: #CACACA"><font><font class="">| </font></font></span> <a href="https://id.zing.vn/v2/register" target="_blank" class="zc" style="cursor: pointer;"><font><font class="">Đăng ký </font></font></a> </div>
答案 0 :(得分:0)
通过XPath定位元素。然后点击它。 (右键单击Chrome,检查,右键单击Đăngnhập并复制XPath。
然后:
driver.FindElement(By.XPath ......点击();
祝你好运