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

Ignoring the error "element's pointer-events is none"

CryptoVolting opened this issue · comments

Rod Version: v0.114.8

How to ignore this error or how to write similar code so that the error does not occur? Because in my conditions, the button often disappears before I can click on it.

el, err := page.Sleeper(rod.NotFoundSleeper).Element(selector)
		if errors.Is(err, &rod.ElementNotFoundError{}) {
		} else if err != nil {
			panic(err)
		} else {
			el.MustClick()
		}

error "element's pointer-events is none"

The same error occurs in this case as well:

page.MustElement(selector)MustClick()		

That means I need the script to continue its work even if the element is not present. Perhaps with this library, I can get the position of the element (X, Y) to press it with a mouse click? However, so far I have not found a way to do this...

Please fix the format of your markdown:

13 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```"]

Please fix the golang code in your markdown:

@@ golang markdown block 1 @@
4:27: expected ';', found MustClick
5:2: expected ';', found 'EOF'
5:2: expected '}', found 'EOF'

generated by check-issue

	point := page.MustElement(selector).MustShape().OnePointInside()
	page.Mouse.MustMoveTo(point.X, point.Y).MustClick(proto.InputMouseButtonRight)