英文:
Is there a way to execute something in the console of a website without opening the DevTools?
问题
我在想是否有可能执行JavaScript代码或将任何内容发送到网站的控制台,而不必打开DevTools。
比如说,我想在控制台中运行函数debug.start()
。然后我必须打开DevTools > 控制台,并在那里输入debug.start()
。
但假设我想执行这个函数而根本不打开DevTools。
我的意思是,有没有一种代码可以代替我执行函数debug.start()
。
是否有这样的方法?如果有,那么是否可以使用Python来实现,因为我最擅长Python。
英文:
So I was wondering if it is possible to execute JavaScript code or send anything to the console of a website without opening the DevTools.
Like lets say I would like to run the function debug.start()
in the console. Then I have to open the DevTools > Console and send there debug.start()
.
But let's say that I would like to execute the function without opening the DevTools at all.
I mean a code, that executes the function debug.start()
for me.
Is there a way to do so? And if so, then is it possible to do that with Python because I know python the best.
答案1
得分: 1
我认为Tampermonkey是你在寻找的东西。这是一个浏览器扩展,允许你编写JavaScript脚本并在网站或特定页面上执行它们。
在这个页面上,你可以找到用户脚本。
英文:
I think Tampermonkey is what you are looking for. This is a browser extension that allows you to write scripts in JavaScript and execute them on websites or on specific pages.
On this page, you can find user scripts.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论