使用Chrome --headless + cookie / oauth令牌拍摄页面截图

时间:2019-04-23 10:47:53

标签: google-chrome google-chrome-devtools headless google-chrome-headless

我发现,可以通过调用以下内容轻松获取页面屏幕截图-https://superuser.com/questions/1410641/how-to-take-screenshots-of-a-list-of-urls-

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --headless --disable-gpu --enable-logging --screenshot="C:\path\to\screenshot.png" http://example.com/

但是,它启动了新的Chrome流程,因此我可以对简单页面进行屏幕截图,但是对带有身份验证的页面(如Oauth2)进行截图呢? 我可以以某种方式让chrome使用浏览器的现有“会话”(我登录到感兴趣的页面)来获取屏幕快照,或者通过某种方式传递oauth2令牌甚至cookie吗?

0 个答案:

没有答案
相关问题