我正在使用 Selenium 进行一些网页抓取。
当名称或 ID 不是选项时,我总是难以找到元素。
该页面是 https://www.portfolio123.com/holdings.jsp?portid=1637063
我试过了
FindElementByClass("btn-primary btn-sm", 10000)
FindElementsByLinkText("Log In", 10000)
FindElementByXPath("//div[@class='btn btn-primary btn-sm']//[@href='javascript:void(goToLoginPage())")
但没有任何成功(我怀疑我需要使用 XPath,但我似乎无法正确
请问有什么帮助吗?(如果你能解释如何解决这个问题,那么我以后就不会遇到真正感激的问题了)