英文:
JavaScript onClick event in golang
问题
尝试使用golang自动化一些Web/浏览器任务时,我在点击、触摸和滑动交互方面遇到了障碍。
感谢令人惊叹的https://github.com/PuerkitoBio/goquery库,我能够解析网页并与表单进行交互。
自动化页面的一个重要部分是模拟触发JavaScript的鼠标点击。
在golang中如何实现这一点?我需要模拟操作系统级别的鼠标点击,还是浏览器有一个可以使用的API?
英文:
In an attempt to automate some web/browser tasks with golang I reached a barrier when if comes comes to click, touch and swipe interaction.
Thanks to the amazing https://github.com/PuerkitoBio/goquery library I am able to parse webpages and I am able to interact with form sheets.
One integral part that is missing to automate pates is simulating mouse clicks that trigger javascript.
How would it be possible to implement this in golang? Do I need to simulate OS level mouse clicks or do browsers have an API that I can use?
答案1
得分: 0
你需要使用类似Selenium的工具,它有至少一个Go语言客户端。
英文:
You would need to use something like Selenium's WebDriver which has at least one go client
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论