在HTTP请求中按下”onclick”的JavaScript。

huangapple go评论74阅读模式
英文:

Press "onclick" js in http request

问题

<img id="img_verify" src="" height="36" width="140" onclick="testing(this);">

有没有办法通过HTTP请求在Go中按下这个按钮?

编辑:
在按钮被按下后,会生成一个由Math.Random生成的10位数字,并放入HTML中,我想获取这个数字。

英文:
<img id="img_verify" src="" height="36" width="140" onclick="testing(this);">

Is there a way to press this button in go with a http request?

Edit:
After the button is pressed there's a 10 digit number generated with Math.Random and put in the html, I want to get the number

答案1

得分: 2

一般情况下,不行。点击该按钮会在网页浏览器中运行一些JavaScript代码;你无法进行任何HTTP请求。可能testing()函数最终会发出一些请求,你可以从Go语言中进行相同的请求,但这取决于具体情况;肯定没有什么可以为你进行翻译的功能。

英文:

In general, no. Clicking that button runs some Javascript inside the web browser; there's no HTTP request anywhere for you to make. It's possible that the testing() function ultimately winds up making some request that you could also make from Go, but that's very situational; there's certainly nothing that will do the translation for you.

huangapple
  • 本文由 发表于 2022年3月16日 02:40:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/71487407.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定