Last active
August 10, 2017 10:15
-
-
Save chawasit/97474764cd01070b7eaf5c62ed66421d to your computer and use it in GitHub Desktop.
from sample
This file contains hidden or 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 { Chromeless } = require('chromeless') | |
| const phoneNumber = '0888866545' | |
| async function run() { | |
| const chromeless = new Chromeless() | |
| const screenshot = await chromeless | |
| .goto('http://namsaijaijing.com/queue/mq.php') | |
| .type(phoneNumber, 'input[name="pnumber"]') | |
| .click('input[name="submit"]') | |
| .wait('#form2') | |
| .evaluate(() => { | |
| document.form2.submit(); | |
| }) | |
| .wait(2000) | |
| .screenshot() | |
| console.log(screenshot) | |
| const url = await chromeless.evaluate(url => window.location.href) | |
| console.log(url) | |
| await chromeless.end() | |
| } | |
| run().catch(console.error.bind(console)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment