Code Monkey home page Code Monkey logo

Comments (12)

carpii avatar carpii commented on September 25, 2024 1

You can fix the download error by applying this change from my fork..

carpii@ac526e2

I suspect yours will break again in the coming weeks, as Barclays move everyone over to the new design. I'll keep working on my fork in the meantime

from barclayscrape.

carpii avatar carpii commented on September 25, 2024

Same issue here. I've upgraded to node 14 (anything more recent seems to need significant code changes)
At this point I was able to upgrade to puppeteer 19 (latest)

This now allows barclayscraper to log in. But they seem to have redesigned the markup for large parts of the site.
Even if we change scraper to bypass the warning screen, it's still unusable

from barclayscrape.

carpii avatar carpii commented on September 25, 2024

I've got login and get_ofx_combined features working again, if you'd like to help me test

# dont overwrite your existing barclayscrape dir
git clone [email protected]:carpii/barclayscrape.git
git checkout site_redesign 

# switch to node 14
nvm install 14
nvm use 14

# npm will report a warning for syncprompt (not sure what thats about yet)
npm install

# run it using node (just incase you normally use npx)
node --trace-warnings barclayscrape.js    <params>

from barclayscrape.

castaway avatar castaway commented on September 25, 2024

I'm on node 18 so probably don't need to upgrade that :)

I did this instead:

git remote add carpii [email protected]:carpii/barclayscrape.git
git checkout -t carpii/site_redesign
npm ci

Than ran my cronjob code, which does: $ENV{BARCLAYSCRAPE}/barclayscrape.js --otp $ENV{CODE} get_ofx $ENV{ACCESS_HOME}"

I got:
Couldn't find selector "div.c-section.c-section--primary" on page https://bank.barclays.co.uk/olb/balances/PersonalFinancialSummary.action#/pfsactions.

Oh thats get_ofx not get_ofx_combined .. trying that one I get:

Couldn't find selector "div.c-section.c-section--primary" on page https://bank.barclays.co.uk/olb/balances/PersonalFinancialSummary.action#/pfsactions. Screenshot saved to ./error.png.
/mnt/allthespace/usrsrc/extern/barclayscrape/barclayscrape.js:76
      await sess.close();
                 ^

TypeError: Cannot read properties of undefined (reading 'close')
    at Command.<anonymous> (/mnt/allthespace/usrsrc/extern/barclayscrape/barclayscrape.js:76:18)

from barclayscrape.

carpii avatar carpii commented on September 25, 2024

Could you check if error.png is showing anything unexpected (like a chrome warning again, or other interim screen).

I'm having to guess a little with the selectors, but for me it shows my list of accounts and seems reliable.

I'm on node 18 so probably don't need to upgrade that :)

Interesting. I had some problems even running it with 18, due to the import syntax changing

from barclayscrape.

castaway avatar castaway commented on September 25, 2024

Hmm looks normal to me.. "Hello Miss Robinson, you last logged in on .. " followed by list of accounts.

btw I havent used combined before, and we only have one account, not sure if relevant.

from barclayscrape.

carpii avatar carpii commented on September 25, 2024

I've just pushed an update to see if that helps.

At this stage we're just trying to match any known element on the page to make sure we were able to login.
I dont think combined_ofx should be a problem with one account. I'll try to tackle the other features soon

from barclayscrape.

castaway avatar castaway commented on September 25, 2024
Couldn't find selector "#welcomePMsg" on page https://bank.barclays.co.uk/olb/balances/PersonalFinancialSummary.action#/pfsactions. Screenshot saved to ./error.png.
/mnt/allthespace/usrsrc/extern/barclayscrape/barclayscrape.js:76
      await sess.close();
                 ^

TypeError: Cannot read properties of undefined (reading 'close')
    at Command.<anonymous> (/mnt/allthespace/usrsrc/extern/barclayscrape/barclayscrape.js:76:18)

from barclayscrape.

carpii avatar carpii commented on September 25, 2024

Have you noticed the site design has changed in the past few days?

I'm wondering if they are doing a gradual rollout and they're still presenting you with the old design.

If thats the case, I think you can just revert back to master, change puppeteer in package.json to be >=19 and npm install (that should fix the chrome warning)

This is the new design...

from barclayscrape.

castaway avatar castaway commented on September 25, 2024

Ah yeah.. mine doesnt look like that! Hmm thought I'd just tried 19.. lets see..

from barclayscrape.

castaway avatar castaway commented on September 25, 2024

Aha that worked!

However, get_ofx_combined does not, I had to change it back to get_ofx, this was the error:

TypeError: this.page._client.send is not a function
    at Services.get_ofx_combined (/mnt/allthespace/usrsrc/extern/barclayscrape/services.js:49:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Command.<anonymous> (/mnt/allthespace/usrsrc/extern/barclayscrape/barclayscrape.js:68:9)

from barclayscrape.

castaway avatar castaway commented on September 25, 2024

Magic, thanks! (If only they'd publish a blasted API.. grrr)

from barclayscrape.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.