X
點擊此處開啟此網站的行動版。
Scheduled maintenance: Thursday, April 2, between 3pm and 5pm UTC. This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn’t solve your issue and you want to ask a question, we have our support community waiting to help you at @firefox on Twitter

技術支援討論區

headless screenshot with delay

已張貼

I'm trying to write a script that would have firefox take a screenshot from the command line, in headless mode (I think). Only issue is that the site I'm trying to screenshot takes a couple of seconds to finish loading, so I only get a partially loaded screenshot. The only option available on the command line is --window-size...

I can take a screenshot inside the dev console with many more options, including --delay (https://developer.mozilla.org/en-US/docs/Tools/Taking_screenshots), is there any way to replicate these options on the command line?

Any other suggestions to script taking a screenshot of a site with delay added?

I'm trying to write a script that would have firefox take a screenshot from the command line, in headless mode (I think). Only issue is that the site I'm trying to screenshot takes a couple of seconds to finish loading, so I only get a partially loaded screenshot. The only option available on the command line is --window-size... I can take a screenshot inside the dev console with many more options, including --delay (https://developer.mozilla.org/en-US/docs/Tools/Taking_screenshots), is there any way to replicate these options on the command line? Any other suggestions to script taking a screenshot of a site with delay added?

由 seedsca 於 修改

引用

額外的系統細節

應用程式

  • User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0

更多資訊

cor-el
  • Top 10 Contributor
  • Moderator
17856 個解決方法 161578 個答案

Did you look at Firefox in headless mode?

Did you look at Firefox in headless mode? *https://developer.mozilla.org/en/Mozilla/Firefox/Headless_mode
這篇文章有幫助嗎? 0
引用

提出問題者

That's what I meant by "on the command line". Headless would have been a much better way to refer to it :)

In headless mode, there is only the option of setting the viewport size, but nothing else related to screenshots. I'd like to set a delay, just as it's possible inside the dev tools console.

That's what I meant by "on the command line". Headless would have been a much better way to refer to it :) In headless mode, there is only the option of setting the viewport size, but nothing else related to screenshots. I'd like to set a delay, just as it's possible inside the dev tools console.
這篇文章有幫助嗎?
引用
問個問題

如果您還沒有帳號,您必須先 登入您的帳號 來回覆文章。請 開始一個新問題