I would like to know whether there is any Java library equivalent to PhantomJS. What I want to achieve is to be able to simulate form login and submit actions from a web page and also to do page scraping as well. I know jsoup does page scraping but not page automation.
Thanks in advance!
Cheers, Alex
Selenium, Electron, Protractor, wkhtmltopdf, and SlimerJS are the most popular alternatives and competitors to PhantomJS.
Being a headless browser, the interactions are much faster than the real browser. So the performance time is smoother in PhantomJS than in Selenium.
PhantomJS And Selenium For Web Automation (Basic) Just like any other browsers with GUI interface (Firefox, IE, Chrome, etc.), for PhantomJS also, Selenium has a standard API to support the automation.
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.
There is a PhantomJS driver for Java called GhostDriver. Maybe this suits your requirements?
Selenium with Ghostdriver/PhantomJS (This is good but there is an issue with automating file uploads for a website. Other automation activites work like a charm!)
Selenium with HtmlUnitDriver. HtmlUnitDriver is based on HtmlUnit which is a GUI less implementation of a browser in Java. (I have had too many exceptions with HtmlUnitDriver)
Jaunt - Their website is http://jaunt-api.com/. Their short description is:
Jaunt Beta is a new, free, Java library for web-scraping & web-automation. The library provides an ultra-light headless browser (ie, no GUI). By using Jaunt your Java programs can easily perform browser-level, document-level, and DOM-level operations. Jaunt is the ideal tool when Javascript support is not required, for tasks including: filling out and submitting forms creating web-bots or web-scraping programs. interfacing with REST APIs or web-apps (HTML, XHTML or XML). automated testing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With