Is it possible to download complete webpage using typhoeus instead of HTML only in Ruby?

248 views Asked by At

I am using ruby to download a complete web page using typhoeus, but it downloads only HTML,

   request = Typhoeus::Request.new(
             "www.example.com",
             method: :get,
             headers: { Accept: "text/html" }
    )

response.body returns only HTML, Can I add any format to download complete webpage with its data which is being loaded via javascript? Or is there any other way to get the data?

1

There are 1 answers

1
Frederick Cheung On

This can't be done in a single request. You need to parse the html to find all the images required and download them

Depending on what you are doing with this, you may need to do the same for other assets on the page (eg css)