简体   繁体   English

在没有浏览器的网站上运行javascript

[英]Run javascript on website without browser

I am using some Tapermonkey (Chrome) scripts that constantly run on website. 我正在使用一些经常在网站上运行的Tapermonkey(Chrome)脚本。 They are executing every 120 seconds and interact with the website: parse text and click website buttons. 他们每120秒执行一次并与网站互动:解析文本并点击网站按钮。 Now I need to transfer this task to embedded platform on Linux with limited resources. 现在,我需要使用有限的资源将此任务转移到Linux上的嵌入式平台。 How can I run these scripts on website without launching the browser, using just some lightweight application? 仅使用某些轻量级应用程序,如何在不启动浏览器的情况下在网站上运行这些脚本? Can I convert userscript into javascript (if this has any sence)? 我可以将用户脚本转换为javascript(如果有任何意义)吗? Is there any javascript engine that allow to load external page and execute the script on it? 是否有任何JavaScript引擎可以加载外部页面并在其上执行脚本?

TRY this : http://jasmine.github.io/ U can test your javascript 试试这个: http : //jasmine.github.io/你可以测试你的javascript

other useful links are 其他有用的链接是

http://docs.seleniumhq.org/ needs browser, to run but its automation , will start browser itself http://docs.seleniumhq.org/需要浏览器才能运行,但其自动化会启动浏览器本身

js unit tests http://jsunit.berlios.de/products.html js单元测试http://jsunit.berlios.de/products.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM