Add options.json
This commit is contained in:
parent
7ef3b56f78
commit
88129ca20d
3
options.json
Normal file
3
options.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"uberPhoneNumber": "4444567891"
|
||||||
|
}
|
@ -1,11 +1,12 @@
|
|||||||
import puppeteer from "puppeteer-core"
|
import puppeteer from "puppeteer-core"
|
||||||
import * as utils from "./utils.js"
|
import * as utils from "./utils.js"
|
||||||
|
import fs from "fs"
|
||||||
|
|
||||||
function sleep(ms) {
|
function sleep(ms) {
|
||||||
return new Promise((resolve) => setTimeout(resolve, ms))
|
return new Promise((resolve) => setTimeout(resolve, ms))
|
||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
let options = JSON.parse(fs.readFileSync("./options.json", "utf8"))
|
||||||
const browser = await puppeteer.launch({
|
const browser = await puppeteer.launch({
|
||||||
headless: false,
|
headless: false,
|
||||||
ignoreHTTPSErrors: true,
|
ignoreHTTPSErrors: true,
|
||||||
@ -50,7 +51,10 @@ async function main() {
|
|||||||
console.log("Went to Page")
|
console.log("Went to Page")
|
||||||
|
|
||||||
await page.waitForSelector(`input[id="PHONE_NUMBER_or_EMAIL_ADDRESS"]`)
|
await page.waitForSelector(`input[id="PHONE_NUMBER_or_EMAIL_ADDRESS"]`)
|
||||||
await page.type(`input[id="PHONE_NUMBER_or_EMAIL_ADDRESS"]`, "1234567891")
|
await page.type(
|
||||||
|
`input[id="PHONE_NUMBER_or_EMAIL_ADDRESS"]`,
|
||||||
|
options.uberPhoneNumber ?? "",
|
||||||
|
)
|
||||||
|
|
||||||
for (let i = 0; i < 100; i++) {
|
for (let i = 0; i < 100; i++) {
|
||||||
await sleep(500)
|
await sleep(500)
|
||||||
|
Loading…
Reference in New Issue
Block a user