rubycdp / ferrum

Headless Chrome Ruby API
https://ferrum.rubycdp.com
MIT License
1.75k stars 127 forks source link

Full screenshots return blank when the page is huge #178

Closed jicheng1014 closed 3 years ago

jicheng1014 commented 3 years ago

when i screenshot the url https://cn.vuejs.org/v2/api/, which have a huge height (:height=>77993)

it returns 0 size jpg when screenshot param full = true

i tried to set browser timeout to 30s

and inserted sleep 10 before command("Page.captureScreenshot", **options), but it didn't work.

Mifrill commented 3 years ago

Hi @jicheng1014, sorry for the late reply. Could you provide the gem version that you used? I did check it for the latest version (0.11), it's working fine:

browser.go_to("https://cn.vuejs.org/v2/api/")
browser.screenshot(path: file, full: true)
screenshot: ![screenshot](https://user-images.githubusercontent.com/23525618/137337213-e74f93e8-b412-4212-b596-1b8c47460134.png)

By the way, I did face Ferrum::PendingConnectionsError on the page visit that may be resolved by an increase of FERRUM_DEFAULT_TIMEOUT env var, just to note.

Mifrill commented 3 years ago

This issue looks outdated, probably, so let's close it for now. @jicheng1014 feel free to reopen if it is still broken for you.