How to obtain href values from a div using xpath?

后端 未结 2 856
旧巷少年郎
旧巷少年郎 2021-01-11 15:05

I have a div like this:

    
                      
相关标签:
2条回答
  • 2021-01-11 15:38
    //div[@class="widget-content"]//a/@href
    

    That should give you the href values of links that are ONLY inside the widget-content DIV.

    0 讨论(0)
  • 2021-01-11 15:44

    relative answer = XPath: find link URL by link text

    "//a/@href"
    
    0 讨论(0)
提交回复
热议问题