0
0
0xC0CAC01A2021-11-12 01:23:49
linux
0xC0CAC01A, 2021-11-12 01:23:49

Analog wget with JavaScript, under Linux?

You need to download a page that is generated by JavaScript. I want one Linux command, something like firefox --just-download-the-bloody-page https://foo.com/bar.html without hemorrhoids with selenium. Is there such a thing?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2021-11-12
@fox_12

npm install nightmare
browser.js

let url = process.argv[2]
var Nightmare = require('nightmare');
var nightmare = Nightmare({show: false,webPreferences: {}})

nightmare
 .goto(url)
 .viewport(1600, 900)
 .wait(5000)
 .evaluate(function() {
     return document.documentElement.innerHTML;
 })
 .end()
 .then(res => {console.log(res)});

node browser.js https://google.com

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question