Created
April 26, 2021 21:37
-
-
Save trestles/a83d11f391155c029680ce628c739823 to your computer and use it in GitHub Desktop.
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
require('dotenv').config(); | |
const puppeteer = require('puppeteer-extra') | |
const select = require ('puppeteer-select'); | |
/* | |
before (async function () { | |
global.baseURL = ''; | |
console.log("within before"); | |
}); | |
*/ | |
puppeteer.launch({ headless: false, defaultViewport: null, | |
executablePath: "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome", | |
slowMo: 100, devtools: false, args: [`--window-size=2000,2000`] }).then(async browser => { | |
const args = require('minimist')(process.argv.slice(2)) | |
console.log(`url: ${args['url']}`); //joe | |
}); | |
/* | |
await page.type('#userId-input', process.env.FIDELITY_USERNAME); | |
await page.type('#password', process.env.FIDELITY_PASSWORD); | |
const aElementsWithHi = await page.$x("//button[contains(., 'Log In')]"); | |
// console.log(aElementsWithHi); | |
await Promise.all([ | |
aElementsWithHi[0].click(), | |
page.waitForNavigation({ | |
waitUntil: 'networkidle0', | |
}), | |
]); | |
console.log('New Page URL:', page.url()); | |
// await page.click('#tab-2') | |
// await page.waitForNavigation({ waitUntil: 'networkidle2' }); | |
// await page.click('.X96492453') | |
// const firstAccount = await page.$x("//td[contains(., 'X96492453')]"); | |
// await page.waitForNavigation() | |
// https://oltx.fidelity.com/ftgw/fbc/oftop/portfolio#positions/X96492453 | |
// await page.goto('https://oltx.fidelity.com/ftgw/fbc/oftop/portfolio#positions/X96492453', { | |
// waitUntil: 'networkidle2' | |
// }); | |
// const element = await select(page).getElement('div.Tag:contains(Events)'); | |
await page.goto('https://oltx.fidelity.com/ftgw/fbc/oftop/portfolio#positions/229772231', { | |
waitUntil: 'networkidle0' | |
}); | |
await page.waitForSelector('.ag-center-cols-container', { | |
visible: true, | |
}); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment