Open AntonJanHart opened 8 months ago
DevTool shows:
<input type="text" placeholder="Username" id="user" name="Username" value="" tabindex="1" class=" userName">
<input type="password" placeholder="Password" id="pass" name="Password" value="" tabindex="2" class=" passWord">
I think I fixed this by changing submit button. src/scrapers/scraper.ts
// await this._page.click('input[type="submit"]')
await this._page.click('#OBSubmit');
I think I fixed this by changing submit button. src/scrapers/scraper.ts
// await this._page.click('input[type="submit"]')
await this._page.click('#OBSubmit');
This fixed the login for me, pls update repo
@AntonJanHart @echo909 thats unlikely what fixed it. The reason why #user is not found is because FNB now has some kind of DDOS protection, that shows up:
You'll see It appears the first time the site loads, then a cookie gets set and the page reloads. You can see it by clearing your cookies on FNB and reloading the page with javascript disabled.
I'm going to try add this before trying to type in a username:
await this._page.waitForSelector('#user', { timeout: 30000 });
That does not appear to work
Upon further inspection:
The capcha doesn't show up on my local.
K, so I worked around this by using 'puppeteer-extra-plugin-recaptcha' and 2captcha.
See: https://www.zenrows.com/blog/puppeteer-captcha-bypass#solver-plugin
My case I didn't get a capcha, but the "verifing your browser", where setting user agent did the trick:
(async () => {
const customUserAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36';
const api = new FnbApi({
username: 'username',
password: 'password',
puppeteerOptions: {
args: [
'--user-agent=${customUserAgent}'
],
}
});
fnb@ftp:~/api$ node main.js Error: No element found for selector: #user at assert (/home/fnb/api/node_modules/fnb-api/node_modules/puppeteer-core/lib/cjs/puppeteer/util/assert.js:28:15) at IsolatedWorld.type (/home/fnb/api/node_modules/fnb-api/node_modules/puppeteer-core/lib/cjs/puppeteer/common/IsolatedWorld.js:221:32) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
fnb@ftp:~/api$ npm list fnb-api fnb-api-master@1.0.9 /home/fnb/api └── fnb-api@1.0.11
fnb@ftp:~/api$ npm show puppeteer-core version 22.0.0