Get source code after running javascript with curl

Is it possible to get the html source code of a web page with curl and run the javascript interpreter on it, so I get the generated content?

On the page, do I need to use some encoded and genetic content, so I want to run javascript first to get the escaped and generated content ... or do I need a javascript regular expression and "compile" javascript on my own? how

curl <myurl> | perl -ne 'm/unescape\((.*)\)/; print "$1"' | <now to something with that> 

I know there is no javascript mechanism in curl, but can I just call another script / program to do this work?

+4
source share
1 answer

You can do it, but it's more involved than I think you understand. Neither curl nor wget have Javascript engines, so you need something that is.

I would start by viewing PhantomJS .

+10
source

Source: https://habr.com/ru/post/1411494/


All Articles