fdciabdul/mutasi-scraper

TypeError: Cannot read properties of undefined (reading 'startsWith')

g00m00nry0ng opened this issue · 4 comments

Kalau ini kenapa ya? saya coba di Windows 11 dengan menjalankan npm run example

BCA Username: xxxxxxxxxx
BCA Password: xxxxxxx
Tanggal awal: 25
Bulan awal: 7
Tanggal akhir: 27
Bulan akhir: 7
[PROXY] connected to remote server at accounts.google.com:443
[ LOG ] Starting ..
[PROXY] connected to remote server at ibank.klikbca.com:443
[PROXY] connected to remote server at ibank.klikbca.com:443
[PROXY] connected to remote server at ibank.klikbca.com:443
[PROXY] connected to remote server at ibank.klikbca.com:443
[PROXY] connected to remote server at ibank.klikbca.com:443
[PROXY] connected to remote server at ibank.klikbca.com:443
[ LOG ] Login to BCA .. [xxxxx]
[PROXY] connected to remote server at www.googleapis.com:443
[PROXY] connected to remote server at content-autofill.googleapis.com:443
[PROXY] connected to remote server at chrome.google.com:443
[PROXY] connected to remote server at www.google.com:443
[ LOG ] Success login ..
[ LOG ] TypeError: Cannot read properties of undefined (reading 'startsWith')
[ LOG ] Logout..
{ status: false, error: null }

ganti function getSettlement jadi getStatement

saya coba demikian pada example.js sehingga jadi begin

// promisifying readline
const readline = require('readline');
const {ScrapBCA} = require("../");
const { promisify } = require('util');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});
rl.question[promisify.custom] = (question) => {
  return new Promise(resolve => {
    rl.question(question, resolve);
  });
};
const questionAsync = promisify(rl.question).bind(rl);

(async () => {
  const username = await questionAsync("BCA Username: ");
  const password = await questionAsync("BCA Password: ");
  const tglawal = await questionAsync("Tanggal awal: ");
  const blnawal = await questionAsync("Bulan awal: ");
  const tglakhir = await questionAsync("Tanggal akhir: ");
  const blnakhir = await questionAsync("Bulan akhir: ");

  const scraper = new ScrapBCA(username, password , {
    headless : false
  });

  var result = await scraper.getStatement(tglawal, blnawal, tglakhir, blnakhir);
  console.log(result);

  // close readline interface
  rl.close();
})();

tapi hasilnya tetap error yg mirip sbb

BCA Username: xxxxxxxxxxxx
BCA Password: xxxxxxxxxx
Tanggal awal: 25
Bulan awal: 7
Tanggal akhir: 27
Bulan akhir: 7
[PROXY] connected to remote server at accounts.google.com:443
[ LOG ] Starting ..
[PROXY] connected to remote server at ibank.klikbca.com:443
[PROXY] connected to remote server at ibank.klikbca.com:443
[PROXY] connected to remote server at ibank.klikbca.com:443
[PROXY] connected to remote server at ibank.klikbca.com:443
[PROXY] connected to remote server at ibank.klikbca.com:443
[PROXY] connected to remote server at ibank.klikbca.com:443
[ LOG ] Login to BCA .. [xxxxxxxxxxxxxxxx]
[PROXY] connected to remote server at content-autofill.googleapis.com:443
[PROXY] connected to remote server at www.googleapis.com:443
[PROXY] connected to remote server at chrome.google.com:443
[PROXY] connected to remote server at www.google.com:443
[PROXY] connected to remote server at ibank.klikbca.com:443
[PROXY] connected to remote server at ibank.klikbca.com:443
[PROXY] connected to remote server at ibank.klikbca.com:443
[PROXY] connected to remote server at ibank.klikbca.com:443
[PROXY] connected to remote server at ibank.klikbca.com:443
[PROXY] connected to remote server at ibank.klikbca.com:443
[PROXY] connected to remote server at ibank.klikbca.com:443
[PROXY] connected to remote server at ibank.klikbca.com:443
[PROXY] connected to remote server at ibank.klikbca.com:443
[ LOG ] Success login ..
[PROXY] connected to remote server at content-autofill.googleapis.com:443
[ LOG ] TypeError: Cannot read properties of undefined (reading 'startsWith')
[ LOG ] Logout..
{ status: false, error: null }

keliatannya error pas mau cek mutasi. saya baca di issue lain katanya tambahkan norek. itu gimana ya maksudnya kalau di example.js penempatannya?

@g00m00nry0ng

i see ..

  const scraper = new ScrapBCA(username, password );

ubah jadi seperti ini aja

karna di update saya tambahkan parameter nomor rekening

@g00m00nry0ng

i see ..

  const scraper = new ScrapBCA(username, password );

ubah jadi seperti ini aja

karna di update saya tambahkan parameter nomor rekening

ok fix, thx Gan