Answer the question
In order to leave comments, you need to log in
How to make a blogger parser with horseman.js?
It is necessary to make a blogger parser, namely, at the moment the task in searching for sites is to find the one you need by the name of the domain and find out the price of posting a post.
I managed to log in to blogun.ru with the following code:
var Horseman = require('node-horseman');
var horseman = new Horseman();
horseman
.viewport(3200,1800)
.userAgent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36')
.open('https://blogun.ru/')
.value('input[name="login"]', '***@mail.ru')
.value('input[name="password"]', '***')
.click('form.shortLoginForm [type="submit"]')
.waitForNextPage(10000)
.url()
.log()
.close();
var Horseman = require('node-horseman');
var horseman = new Horseman();
horseman
.viewport(3200,1800)
.userAgent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36')
.open('https://new.blogun.ru/search')
.close();
DEBUG=horseman node test2.js
horseman using PhantomJS from $PATH +0ms
horseman .setup() creating phantom instance 1 +8ms
horseman .viewport() set 3200 1800 +28ms
horseman phantom created +237ms
horseman phantom version 1.9.8 +30ms
horseman page created +15ms
horseman phantomjs onLoadFinished triggered success NaN +14ms
horseman injected jQuery +30ms
horseman .userAgent() set Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36 +28ms
horseman .open() https://new.blogun.ru/search +1ms
horseman phantomjs onLoadFinished triggered fail 1 +86ms
horseman .close(). +2ms
Unhandled rejection Error: Failed to GET url: https://new.blogun.ru/search
at checkStatus (/root/node_modules/node-horseman/lib/actions.js:78:16)
at PassThroughHandlerContext.finallyHandler (/root/node_modules/bluebird/js/release/finally.js:57:23)
at PassThroughHandlerContext.tryCatcher (/root/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/root/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/root/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/root/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/root/node_modules/bluebird/js/release/promise.js:693:18)
at Promise._fulfill (/root/node_modules/bluebird/js/release/promise.js:638:18)
at /root/node_modules/bluebird/js/release/nodeback.js:42:21
at /root/node_modules/node-phantom-simple/node-phantom-simple.js:60:18
at IncomingMessage.<anonymous> (/root/node_modules/node-phantom-simple/node-phantom-simple.js:645:9)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question