Last active
December 19, 2020 18:51
-
-
Save sksat/2a1620226fee2134b687c4fbcf4617f2 to your computer and use it in GitHub Desktop.
7bank deposit
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
const config = require("./config.js"); | |
const puppeteer = require("puppeteer"); | |
(async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
const navigationPromise = page.waitForNavigation(); | |
await page.goto( | |
"https://ib.sevenbank.co.jp/IB/IB_U_CO_002/IB_U_CO_002_100.aspx?Lang=ja-JP" | |
); | |
await page.setViewport({ width: 1712, height: 959 }); | |
await page.click("tbody #cphBizConf_txtLogonId"); | |
await page.type("tbody #cphBizConf_txtLogonId", config.id); | |
await page.click("tbody #cphBizConf_txtLogonPw"); | |
await page.type("tbody #cphBizConf_txtLogonPw", config.password); | |
await page.click("input[value='ログオン']"); | |
await page.waitForNavigation({timeout: 60000, waitUntil: "domcontentloaded"}); | |
await page.screenshot({path: "login.png"}); | |
const deposit = await page.evaluate(() => document.querySelector('#cphBizConf_lblDepositSum').innerText.replace(",", "")); | |
console.log(deposit); | |
await navigationPromise; | |
await browser.close(); | |
})(); |
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
const config = { | |
id: "baka", | |
password: "aho" | |
}; | |
module.exports = config; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment