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

心不动则不痛 提交于 2019-11-30 07:46:51
troelskn

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

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

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!