Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于页面需要登陆问题 #12

Open
ocsen opened this issue Sep 9, 2019 · 9 comments
Open

关于页面需要登陆问题 #12

ocsen opened this issue Sep 9, 2019 · 9 comments

Comments

@ocsen
Copy link

ocsen commented Sep 9, 2019

请问一下,有很多页面需要登录之后才能正常预览和生成骨架屏,这里你们是如何来解决的呢?
配置 setExtraHTTPHeaders 吗
还是用puppeteer的setCookie来处理?

@famanoder
Copy link
Owner

可以设置setExtraHTTPHeaders,也可以在项目中直接调用evalDOM来生成

@ZZZhangrong
Copy link

直接使用extraHTTPHeaders传递登录信息并没有生效,请问setExtraHTTPHeaders是怎么用的 @famanoder

@1927344728
Copy link

同问
登录问题,你们解决了吗?
evalDOM生成的骨架代码,怎么自动注入到html中(下一次访问,可以看到骨架预览效果)?

@ZZZhangrong
Copy link

我使用page.setCookie解决了,Puppeteer在0.10.2后不支持maps,具体见下面链接:
Puppeteer 0.10.2 started using objects instead of maps for headers: https://github.com/GoogleChrome/puppeteer/releases/tag/v0.10.2

@ZZZhangrong
Copy link

@1927344728

@1927344728
Copy link

再请教一下
page.setCookie方法是在哪里调用的? 在dps.config.js中的其个回调函数中,还是需要自己启动一个puppeteer? @ZZZhangrong

@ZZZhangrong
Copy link

pp.js文件里之前用的page.setExtraHTTPHeaders设置,替换成page.setCookie方法 @1927344728

@1927344728
Copy link

pp.js文件里之前用的page.setExtraHTTPHeaders设置,替换成page.setCookie方法 @1927344728

是要改插件里面的pp.js中的方法。
好的。谢谢

@wangxingxing123654
Copy link

我使用page.setCookie解决了,Puppeteer在0.10.2后不支持maps,具体见下面链接:
Puppeteer 0.10.2 started using objects instead of maps for headers: https://github.com/GoogleChrome/puppeteer/releases/tag/v0.10.2
能贴代码吗?不生效

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants