How to manage log in session through headless chrome?

后端 未结 4 1810
太阳男子
太阳男子 2020-12-23 09:08

I want to create a scraper that:

  1. opens a headless browser,
  2. goes to a url,
  3. logs in (there is steam oauth),
  4. fills some inputs,
4条回答
  •  被撕碎了的回忆
    2020-12-23 09:55

    There is an option to save user data using the userDataDir option when launching puppeteer. This stores the session and other things related to launching chrome.

    puppeteer.launch({
      userDataDir: "./user_data"
    });
    

    It doesn't go into great detail but here's a link to the docs for it: https://pptr.dev/#?product=Puppeteer&version=v1.6.1&show=api-puppeteerlaunchoptions

提交回复
热议问题