how to get attribute value using selenium and css

后端 未结 2 586
刺人心
刺人心 2020-12-19 07:26

I have the following HTML code:

 2 
<
2条回答
  •  盖世英雄少女心
    2020-12-19 08:21

    Changing css=a@href to href should do the trick. Let me if this did not work.

        List ele = driver.findElements(By.className("c"));
            for(WebElement e : ele)
            {
               String doctorname = e.getText();
               String linkValue = e.getAttribute("href");
            }
    

提交回复
热议问题