Real headless browser

北慕城南 提交于 2019-11-28 17:58:19
Edward Wilde

This has been done by the guys over at http://www.phantomjs.org/. In their own words:

PhantomJS is a headless WebKit with JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG.

PhantomJS is an optimal solution for headless testing of web-based applications, site scraping, pages capture, SVG renderer, PDF converter and many other use cases.

PhantomJS is created by Ariya Hidayat

You might be able to take advantage of some of the available JavaScript unit testing tools to assemble the sort of environment you need.

For example I've found that loading env.js in rhino gives an acceptable fake browser for testing most JavaScript. It falls short on certain DOM attributes, like elements sized relative to their window, but that hasn't been a serious problem in my experience.

See also:

Take a look at LoadBooster. It is a cloud-based load testing service which utilizes headless browser PhantomJS to test web sites. Disclaimer: I work for LoadBooster.

Have a look at WebKitDriver. The project includes headless implementation of WebKit.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!