Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xpath元素存在但是无法点击 #685

Closed
feeops opened this issue Aug 12, 2022 · 1 comment
Closed

xpath元素存在但是无法点击 #685

feeops opened this issue Aug 12, 2022 · 1 comment
Labels
question Questions related to rod

Comments

@feeops
Copy link

feeops commented Aug 12, 2022

Rod Version: v0.108.2

The code to demonstrate your question

package main

import (
   "fmt"
   "github.com/go-rod/rod"
   "github.com/go-rod/rod/lib/launcher"
)

var page *rod.Page

func main() {

   startURL := "https://www.baidu.com/"
   u := launcher.MustResolveURL("9222")

   browser := rod.New().NoDefaultDevice().ControlURL(u).MustConnect()
   page = browser.MustPage(startURL).MustWaitLoad()
   var sel = `//a[contains(text(),'登录')]`
   fmt.Println(page.HasX(sel))
   page.MustElementX(sel).MustClick()
   fmt.Println("执行成功")

}

此元素是存在并可见的,但是就是无法点击,卡死了

@feeops feeops added the question Questions related to rod label Aug 12, 2022
@ysmood
Copy link
Member

ysmood commented Aug 12, 2022

提问不符合规则 2 和 3,因此关闭: #322

@ysmood ysmood closed this as not planned Won't fix, can't repro, duplicate, stale Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Questions related to rod
Projects
None yet
Development

No branches or pull requests

2 participants