Module: Ferrum::Page::Screenshot
- Included in:
- Ferrum::Page
- Defined in:
- lib/ferrum/page/screenshot.rb
Instance Method Summary collapse
Instance Method Details
#pdf(**opts) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/ferrum/page/screenshot.rb', line 14 def pdf(**opts) path, encoding = (**opts) = (**opts) data = command("Page.printToPDF", **).fetch("data") return data if encoding == :base64 save_file(path, data) end |
#screenshot(**opts) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/ferrum/page/screenshot.rb', line 6 def screenshot(**opts) path, encoding = (**opts) = (path, **opts) data = command("Page.captureScreenshot", **).fetch("data") return data if encoding == :base64 save_file(path, data) end |