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

Click Button Eval Js Not Working #1054

Closed
refaldyrk opened this issue May 3, 2024 · 4 comments
Closed

Click Button Eval Js Not Working #1054

refaldyrk opened this issue May 3, 2024 · 4 comments
Labels
question Questions related to rod

Comments

@refaldyrk
Copy link

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>
@refaldyrk refaldyrk added the question Questions related to rod label May 3, 2024
@refaldyrk
Copy link
Author

How To Fix It

Copy link

github-actions bot commented May 3, 2024

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

@refaldyrk
Copy link
Author

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

@ysmood
Copy link
Collaborator

ysmood commented May 5, 2024

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

	fmt.Println(obj, err)

@ysmood ysmood closed this as completed May 5, 2024
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