puppeteer 로그인 세션 유지 관련 질문입니다

조회수 351회

로그인 정보 가져와서 로그인하는 것까지는 성공했는데 로그인 세션 유지하려면 sessionStorage나 localStorage를 사용해야 할 것으로 확인되는데 문법 확인 좀 해주시면 감사드리겠습니다. const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch({ headless : false }); const page = await browser.newPage(); await page.setViewport({ width: 1200, height: 1080 }); const test_id = "test"; const test_pw = "test!"; const a = '#a'; const image_url = 'https://test.test.re.kr/testibp/test/img/login_btn.png'; await page.goto('https://test.test.re.kr/testibp/login.jsp'); await page.waitForTimeout(3000); await page.evaluate((id, pw, a) => { document.querySelector('#userId').value = id; document.querySelector('#pwd').value = pw; sessionStorage.getItem('#userId', '#pwd'); sessionStorage.setItem('#userId', '#pwd'); }, test_id, test_pw, a); await page.click('a'); })();

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)