10
votes

I am successfully using the Conductor framework to scrape data off a website. I use the Chrome browser and therefore I have installed chromedriver.exe in the root of my project.

To speed things up I want to replace Chrome with the headless PhantomJS browser. I installed PhantomJS as explained in the answer to this Stackoverflow question: PhantomJS & Conductor Framework and have changed the browser to Browser.PHANTOMJS in @Config.

Whatever I do however, I get no results.

I found no documentation how to setup PhantomJS for use with Selenium or PhantomJS.

The question How to Implement Selenium WebDriver with PhantomJS and Can we Use Sikuli with PhantomJS? did not help either.

How to replace Chrome with PhantomJS for use with Selenium and Conductor?

2

2 Answers

8
votes

The trouble you are having appears to be due to an older version of the PhantomJS library included in Conductor. The error when running PhantomJS can be found in this imported issue on the Selenium Github. The remedy is to import a fork of PhantomJS which works with the newer releases of Selenium.

You can easily implement this by editing the pom.xml file and swapping

<groupId>com.github.detro</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>${phantomjs_version}</version>

with

<groupId>com.codeborne</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>1.2.1</version>
0
votes

You can use a headless chrome driver with selenium, as showed here:

https://duo.com/decipher/driving-headless-chrome-with-python