Closed owlinux1000 closed 6 years ago
Check if a error
is returned. This can be the case if your element is not found.
err := bow.Click("a[href=\"https://example.com\"]")
if err != nil {
// error handling here
}
This works fine for me.
I don't know what the Yen-symbol (¥
) is doing there, but I think you have to escape the "
I'm sorry that the url I specified is wrong. I can click a tag.
Exactly, I use Yen-symbol to escape "
.
Thanks a lot!
I didn't know it's possible to do ¥"
instead of \"
Maybe it is because I use JIS keyboard layout.
If the URL contains the percent-encoding strings, Click
method can't find matching expr ?
Can you give an example?
I tried to click
<a href="http://localhost:8080/index.php?p=Hello%21">Link</a>
with
err := bow.Click("a[href=\"http://localhost:8080/index.php?p=Hello%21\"]")
and it worked fine.
I guess you can escape it like this:
u := "http://localhost:8080/index.php?" + url.PathEscape("p=Hello!")
err := bow.Click("a[href=\"" + u + "\"]")
I can't show my issue to you because of private task.
Umm... I can work your codes. Perhaps, I guess there are any other reasons. I'm going to try again.
I'll close this issue because I resolved my issue. However, refreshing of meta tag can't work in my task...
I want to click a tag. How do I write the parameter of
Click
method ? I tried this way.