英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论