PyPhantomJS is a headless WebKit with JavaScript API, based on the PhantomJS project.
It has fast and native support for DOM handling, CSS selector, JSON, Canvas, SVG, and of course JavaScript.
PyPhantomJS scripts can be written in JavaScript or CoffeeScript.
See the quick start guide and more advanced examples which show various PhantomJS scripts, covering:
- running regression tests from command line
- getting driving direction
- showing weather forecast conditions
- finding pizza in New York
- looking up approximate location based on IP address
- pulling the list of seasonal food
- producing PDF version of a Wikipedia article
- rasterizing SVG to image
PyPhantomJS is written in PyQt4 and Python. It runs on Linux, Windows, and Mac OS X.
Refer to the INSTALL file or Wiki links1 for more information.
Do not forget to consult the concise API Reference2
If you want to contribute, please read the Contribution Guides3
You can find a list of downloadable plugins here.
If you would like to know how to make plugins, check out this article.
1: http://code.google.com/p/phantomjs/w/list
1: http://dev.umaclan.com/projects/pyphantomjs/wiki
2: http://dev.umaclan.com/projects/pyphantomjs/wiki/Api_reference
2: http://code.google.com/p/phantomjs/wiki/Interface
3: http://code.google.com/p/phantomjs/wiki/ContributionGuide
3: http://dev.umaclan.com/projects/pyphantomjs/wiki/Giving_back
Product's homepage
Requirements:
· Python
· PyQt
· Qt
What's New in This Release: [ read full changelog ]
Bug fixes:
· Fixed open() and POST method, without specifying the finished handler
· Fixed script execution warning dialog (issue 165)
· Added WebPage.release() to free the web page from memory (issue 154)
· Added special handling of about:blank (issue 235)
· Made a separate network access manager for each page (issue 190)
New features:
· Introduced file system API based on CommonJS Filesystem proposal (issue 129)
· Added support for persistent cookies (issue 91)
· Added event handling, currently only for mouse events (issue 234)
· Added page scroll position (issue 162)
· Added HTTP authentication support (issue 45)
· Added callback for page initialization (issue 143)
· Added support to specify script and output encoding (issue 186)
· Added option to allow local content to do cross-domain access (issue 28)
· Added support to apply configurations from a JSON file (issue 180)
· Added a convenient WebPage initialization construction (issue 206)
· Added option to limit the size of disk cache (issue 220)
Examples:
· Added a new example on using Modernizr to detect features (issue 144)
· Fixed pizza.js example to use Mobile Yelp (issue 200)
· Fixed netsniff.coffee example due to wrong indentation (issue 225)
· Added an example to show live network traffic (issue 227)
· Added an example demonstrating different output encodings (issue 186)