Menu
Original author(s) | Ariya Hidayat |
---|---|
Developer(s) | Ariya Hidayat |
Initial release | January 17, 2011; 9 years ago |
Stable release | |
Repository | |
Written in | C++ |
Type | Headless browser |
License | BSD[2] |
Website | phantomjs.org |
PhantomJS is a discontinued headless browser used for automating web page interaction. PhantomJS provides a JavaScript API enabling automated navigation, screenshots, user behavior and assertions making it a common tool used to run browser-based unit tests in a headless system like a continuous integration environment. PhantomJS is based on WebKit making it a similar browsing environment to Safari and Google Chrome (before Chrome's fork of WebKit evolved into Blink). It is open-source software released under the BSD License.[2]
History[edit]
PhantomJS was released January 23, 2011 by Ariya Hidayat after several years in development.[3]
The first commit to the public project was in 2011.[4]
The logo commonly used to pictorially refer to PhantomJS is a fluorescent blue ghost atop a black background. This refers to the lack of graphical user interface, or main body of the browser, making PhantomJS users seem like ghosts.
I guess if you are new to GNU/Linux environment this can seem unusual, but it is perfectly typical. You just need to unpack the phantomjs file from its zip file, then make it executable a la `chmod +x phantomjs`, then run it a la `./phantomjs` (or copy it to /usr/bin and then run it by just typing `phantomjs`). Sep 19, 2020 Alternatives to Phantomjs for Windows, Linux, Mac, Web, Self-Hosted and more. Filter by license to discover only free or Open Source alternatives. This list contains a total of 25+ apps similar to Phantomjs. List updated: 9/19/2020 10:25:00 AM. PhantomJS is a free software and is distributed under the BSD License.It is easy to install and it offers multiple features to execute the scripts. PhantomJS can be easily run on multiple platforms such as Windows, Linux, and Mac. PhantomJS is a headless WebKit scriptable with a JavaScript API multiplatform, available on major operating systems as: Windows, Mac OS X, Linux, and other Unices. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG. On Apple Mac you can install PhantomJS with the line: brew install phantomjs: On Microsoft Windows or Linux, get PhantomJS from the official site. Selenium PhantomJS. To use the PhantomJS webdriver, all you need to do is change it to PhantomJS. Example PhantomJS code.
In March 2018, the development of PhantomJS was suspended due to lack of active contributions.[5]
PhantomJS usage[edit]
The PhantomJS JavaScript API can be used to open web pages, take screenshots, execute user actions, and run injected JavaScript in the page context. For example, the following code will open Wikipedia and, upon loading, will save a screenshot to a file and exit.
Tools using PhantomJS[edit]
CasperJS[edit]
Shortly after the release of PhantomJS, Nicolas Perriault wrote CasperJS, a suite of libraries on top of PhantomJS that extend its capabilities as a client for automated web page testing. CasperJS and PhantomJS have become valuable enough that similar projects have started to adopt the API as a standard way of interacting with headless browsers.[6][7]
YSlow[edit]
Yahoo! developed a version of YSlow that leverages PhantomJS to gather performance metrics for websites.[8]
Companies using PhantomJS[edit]
- Twitter used QUnit and PhantomJS for unit testing as of 2015.[9]
- LinkedIn used PhantomJS based tools for performance testing as of 2011.[10]
- Netflix used Sketchy, a headless browser built with PhantomJS, to understand what it’s doing without having to visit the site as of 2014.[11]
- Time Warner Cable used PhantomJS with CoffeeScript, Jasmine, and JUnit XML for Jenkins continuous integration as of 2012.[12]
Other uses for PhantomJS[edit]
PhantomJS was made for programmatic control of web sites and has been used for many purposes from visual differencing of websites[13] to automated testing of JavaScript frameworks.[14]
Phantomjs For Mac Installer
Server rendering of client-side JavaScript[edit]
With the rise of client-side JavaScript and the SEO problems that practice presents, developers turned to PhantomJS as a way to pre-render static HTML for initial requests.[15][16] Despite the performance impact of such an approach, it remained one of the simplest ways to improve SEO without rewriting a web application, spawning services trying to automate the process.[17]
Malicious use of PhantomJS[edit]
Because PhantomJS is runnable without a UI, scriptable via JavaScript, and relatively adherent to modern browser specifications, it is commonly used as a way to automate attacks against web sites.[18] PhantomJS mimics legitimate user traffic and can complicate attack mitigation technologies. PhantomJS can also be used to automatically verify logins across disparate web sites[19] (credential stuffing), compounding the problems that arise after a site is breached and usernames and passwords are leaked.
See also[edit]
References[edit]
- ^'Releases · ariya/phantomjs'. GitHub. Retrieved 21 April 2017.
- ^ ab'phantomjs/LICENSE.BSD at master · ariya/phantomjs'. GitHub.
- ^'don't code today what you can't debug tomorrow'. ariya.blogspot.com. Retrieved 20 July 2015.
- ^'ariya/phantomjs'. GitHub. Retrieved 20 July 2015.
- ^'Archiving the project: suspending the development'. ariya/phantomjs. Github. 2018-03-03.
- ^Laurent Jouanneau. 'FaQ - SlimerJS'. slimerjs.org. Retrieved 20 July 2015.
- ^'trifleJS'. trifleJS. Retrieved 20 July 2015.
- ^Marcel Duran. 'YSlow - Official Open Source Project Website'. yslow.org. Retrieved 20 July 2015.
- ^'Leo Lanese on Twitter'. Twitter. Retrieved 20 July 2015.
- ^phegaro. 'LinkedIn Mobile: How do we do it?'. SlideShare. Retrieved 20 July 2015.
- ^Michael Mimoso. 'Netflix Open Source Security Tools Solve Range of Challenges'. threatpost.com. Retrieved 20 July 2015.
- ^'one year of wandering headlessly'. ofilabs.com. Retrieved 20 July 2015.
- ^'Huddle/PhantomCSS'. GitHub. Retrieved 20 July 2015.
- ^EisenbergEffect. 'Docs - Testing with PhantomJS and Jasmine - Durandal'. durandaljs.com. Retrieved 20 July 2015.
- ^'Short story about rendering HTML, client side vs server side'. eshlox. Retrieved 20 July 2015.
- ^Aaron O'Connell (22 April 2014). 'Sever-Side Rendering of Single Page Apps using PhantomJS and Node.js'. 42floors.com. Retrieved 20 July 2015.
- ^'BromBone - SEO for your AngularJS, EmberJS, or BackboneJS website'. Brombone.com. Retrieved 20 July 2015.
- ^'DDoS Attack Used 'Headless' Browsers In 150-Hour Siege'. Dark Reading. Retrieved 20 July 2015.
- ^'Logging in to Amazon using PhantomJS'. GitHub Gists. Retrieved 20 July 2015.
External links[edit]
![Windows Windows](/uploads/1/2/6/4/126449812/537562507.png)
Retrieved from 'https://en.wikipedia.org/w/index.php?title=PhantomJS&oldid=955942530'
New to PhantomJS? Read and study the Quick Start guide.
Windows
Download phantomjs-2.1.1-windows.zip (17.4 MB) and extract (unzip) the content.
The executable
phantomjs.exe
is ready to use.Note: For this static build, the binary is self-contained with no external dependency. It will run on a fresh install of Windows Vista or later versions. There is no requirement to install Qt, WebKit, or any other libraries.
Mac OS X
Download phantomjs-2.1.1-macosx.zip (16.4 MB) and extract (unzip) the content.
Note: For this static build, the binary is self-contained with no external dependency. It will run on a fresh install of OS X 10.7 (Lion) or later versions. There is no requirement to install Qt or any other libraries.
Phantomjs-prebuilt For Mac
Linux 64-bit
Download phantomjs-2.1.1-linux-x86_64.tar.bz2 (22.3 MB) and extract the content.
Note: For this static build, the binary is self-contained. There is no requirement to install Qt, WebKit, or any other libraries. It however still relies on Fontconfig (the package libfontconfig, depending on the distribution). The system must have GLIBCXX_3.4.9 and GLIBC_2.7.
fontconfig
or Linux 32-bit
Download phantomjs-2.1.1-linux-i686.tar.bz2 (23.0 MB) and extract the content.
Note: For this static build, the binary is self-contained. There is no requirement to install Qt, WebKit, or any other libraries. It however still relies on Fontconfig (the package
fontconfig
or libfontconfig
, depending on the distribution). The system must have GLIBCXX_3.4.9 and GLIBC_2.7.FreeBSD
Binary packages are available via pkg:
Source Code
To get the source code, check the official git repository: github.com/ariya/phantomjs.
To compiled PhantomJS from source (not recommended, unless it is absolutely necessary), follow the build instructions.
Checksums
To verify the integrity of the downloaded files, use the following checksums.
MD5 Checksums
SHA-256 Checksums
Acknowledgement
Download service is kindly provided by BitBucket and previously by Google Code Project Hosting.