What is the Java equivalent to PhantomJS? [closed]
Asked Answered
T

3

15

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

Taam answered 3/11, 2013 at 23:19 Comment(1)
Any Java equivalent? I am interested in page simulation and automation.Taam
A
8

There is a PhantomJS driver for Java called GhostDriver. Maybe this suits your requirements?

Averett answered 30/4, 2014 at 9:56 Comment(1)
I found that GhostDrive hides many capabilities of PhantomJS. Like convert page to PDF for example.Cappella
C
6
  1. 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!)

  2. 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)

  3. 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.

Connote answered 29/3, 2015 at 3:48 Comment(2)
Why not use just HtmlUnit? Jaunt is not the equivalent since it does not support JavaScript.Bobbiebobbin
It's not equivalent because it has an expiration system to force you to pay when you want to use it on the long term: jaunt-api.com/products.htmSapienza
P
2

Here's a similar question and answer with a list of options for you. Not all are written in Java, but there may be some suitable options for you.

headless internet browser?

Pulchi answered 3/11, 2013 at 23:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.