Skip to content

Instantly share code, notes, and snippets.

@koungkub
Created October 6, 2019 06:57
Show Gist options
  • Save koungkub/08f04f48465fbc05ba7056c4b31e477b to your computer and use it in GitHub Desktop.
Save koungkub/08f04f48465fbc05ba7056c4b31e477b to your computer and use it in GitHub Desktop.
ds
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