Created
October 6, 2019 06:57
-
-
Save koungkub/08f04f48465fbc05ba7056c4b31e477b to your computer and use it in GitHub Desktop.
ds
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 puppeteer = require('puppeteer-core') | |
const eiei = async () => { | |
const browser = await puppeteer.launch({ | |
headless: false, | |
defaultViewport: null, | |
executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' | |
}) | |
const page = await browser.newPage(); | |
while (true) { | |
await page.goto('https://regist.ชิมช้อปใช้.com/Register/') | |
const bodyHandle = await page.$('body') | |
const html = await page.evaluate(body => body.innerHTML, bodyHandle) | |
if (html.includes('ขณะนี้คุณอยู่ระหว่างการรอคิวเพื่อลงทะเบียน')) { | |
continue | |
} else { | |
setInterval(() => console.log('Found'), 1000) | |
break | |
} | |
} | |
} | |
eiei() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment