Last active
June 23, 2020 09:11
-
-
Save shriyaRam/c2cee293616b3187333f2aeb1cbad151 to your computer and use it in GitHub Desktop.
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
if(links[1]=='https://ramshri.signalwire.com/phone_numbers/new' || links[2]=='https://ramshri.signalwire.com/phone_numbers/new') | |
{ | |
if(link[1]=='https://ramshri.signalwire.com/phone_numbers/new') | |
{ | |
await page.goto(links[1]) | |
} | |
else | |
{ | |
await page.goto(links[2]) | |
} | |
await page.waitForSelector('#search_areacode') | |
await page.type('#search_areacode', req.body.areanum);//massachusetts number | |
await page.keyboard.press('Enter').then(async () => { await page.waitForNavigation({waitUntil: 'load'})}).catch(()=>{console.log("Couldn't search")}); | |
const buy = 'input[class="btn btn-sm btn-outline-confirm px-4 mr-2"]'; | |
await page.evaluate('window.confirm = () => true') | |
await page.evaluate((buy) => document.querySelector(buy).click(), buy).then(async () => { await page.waitForNavigation({waitUntil: 'load'})}).catch(()=>{console.log("Couldn't choose connector")});; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment