go-rod / rod

A Chrome DevTools Protocol driver for web automation and scraping.

Home Page:https://go-rod.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Click Button Eval Js Not Working

refaldyrk opened this issue · comments

image

In My Code

obj, err := p.Eval(`document.querySelector('#base-contextual-sign-in-modal > div > section > button').click()`)

	fmt.Println(obj, err)

Output

<nil> eval js error: TypeError: Cannot read properties of undefined (reading 'apply')
    at <anonymous>:1:74 <nil>

How To Fix It

Please add a valid Rod Version: v0.0.0 to your issue. Current version is v0.115.0

Please fix the format of your markdown:

1:1 MD033/no-inline-html Inline HTML [Element: img]
4:11 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
5 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```go"]
12 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```bash"]

generated by check-issue

github.com/go-rod/rod v0.115.0

obj, err := p.Eval(`() => {
  document.querySelector('#base-contextual-sign-in-modal > div > section > button').click()
}`)

	fmt.Println(obj, err)