Last active
November 4, 2020 11:55
-
-
Save deptno/bb89e0f2bd406465acdc72dda4ab297b to your computer and use it in GitHub Desktop.
rtx3080
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const rog = 'http://www.11st.co.kr/products/3126107080?trTypeCd=03&trCtgrNo=2046005' | |
const tuf = 'http://www.11st.co.kr/products/3052905270?trTypeCd=03&trCtgrNo=2046005' | |
const puppeteer = require('puppeteer') | |
const vulcan = 'http://www.11st.co.kr/products/3136907976?xfrom=&xzone=&ts=1604400314021' | |
const cases = 'http://www.11st.co.kr/products/2314458619' | |
async function main(url) { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
await page.setViewport({ | |
width: 1280, | |
height: 1024, | |
deviceScaleFactor: 1, | |
}); | |
await page.goto(url, {waitUntil: 'networkidle2'}); | |
const src = await page.evaluate(() => { | |
const btn = document.querySelector('a[data-log-actionid-label=login]') | |
btn.click() | |
return btn.href | |
}); | |
await page.screenshot({path: 'example.png'}); | |
await page.evaluate(() => { | |
document.querySelector('#loginName').value = '' | |
document.querySelector('#passWord').value = '' | |
return document.querySelector('#loginName').value | |
}) | |
await page.click('input[data-log-actionid-label=login][type=button]') | |
await new Promise(r => setTimeout(r, 1000)) | |
await page.screenshot({path: 'example2.png'}); | |
await browser.close(); | |
} | |
main(cases) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment