Here are the dependencies you will need to use Selenium and PhantomJS with Maven. and in your code call the following WebDriverManager downloads the latest version of the required PhantomJS binary to be used with Selenium WebDriver.
When using PhantomJS visa GhostDriver with Selenium, you will get all kinds of log messages which would not be necessary in some instances. The example below shows how to disable these log messages.
The example below shows how you can configure PhantomJS to use proxies with your web testing.