Answer the question
In order to leave comments, you need to log in
How to use Selenium webdriver along with phantomjs?
I am writing an instagram liker bot and for the first time I had to work with selenium webdriver for node.js.
With the help of npm, selenium itself and phantom.js are already installed. However, when trying to run the code, it gives an error "webdriver.Capabilities.phantomjs() is not a function" line 8. How can I fix it?
Answer the question
In order to leave comments, you need to log in
Raise the selenium hub, with a pool of nodes (chrome / ff / opera instances)
Then just connect to the hub and take the first free node
var SELENIUM_HOST = 'http://localhost:4444/wd/hub';
var URL = 'https://instagram.com';
var browser = new webdriver.Builder()
.usingServer(SELENIUM_HOST)
.withCapabilities({ browserName: 'chrome' })
.build();
browser.get(URL);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question