Can you deploy Watir on Heroku to generate HTML Snapshots? If so, how?

前端 未结 3 1043
有刺的猬
有刺的猬 2020-12-30 17:52

I would like to generate HTML Snapshots using Watir, hosted on Heroku.

Google\'s Full Specification for Making AJAX

相关标签:
3条回答
  • 2020-12-30 18:29

    Yes you can

    Use Watir with PhantomJS, which is headless

    browser = Watir::Browser.new :phantomjs
    

    To use PhantomJS on Heroku, you'll need to use a Heroku PhantomJS buildpack

    0 讨论(0)
  • 2020-12-30 18:37

    No. You need a full desktop environment to run watir. Heroku doesn't provide you with that.

    You could use a service such as Amazon EC2

    0 讨论(0)
  • 2020-12-30 18:46

    Troelskin's answer is incorrect. There are ways to run "headless" browsers with Watir, which do not require a "full desktop environment". Having said that, I do not know which method may be appropriate on Heroku.

    Other "headless" automation options (if you are using Ruby) are Mechanize with Open-Uri, along with (optional) Nokogiri.

    0 讨论(0)
提交回复
热议问题