E
E
Eugene2018-09-07 23:33:54
Bots
Eugene, 2018-09-07 23:33:54

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?
_SCtgfrzzgI.jpg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
O. J, 2018-09-07
@you_are_enot

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);

run the liker in the number of threads = the number of nodes in the pool

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question