Skip to content

Instantly share code, notes, and snippets.

@deptno
Last active November 4, 2020 11:55
Show Gist options
  • Save deptno/bb89e0f2bd406465acdc72dda4ab297b to your computer and use it in GitHub Desktop.
Save deptno/bb89e0f2bd406465acdc72dda4ab297b to your computer and use it in GitHub Desktop.
rtx3080
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