gymbox-bot icon indicating copy to clipboard operation
gymbox-bot copied to clipboard

Issue with running the CLI program

Open Annaeiros opened this issue 5 years ago • 7 comments

I am having the following issue:

$ node cli.js -c run
2019-10-19T18:57:30+01:00 - Run booking of classes process with email: [email protected]
2019-10-19T18:57:30+01:00 - Login succeed code:
2019-10-19T18:57:31+01:00 - Fetched bookable clubs
2019-10-19T18:57:31+01:00 - Fetched time table for club Id 15
2019-10-19T18:57:46+01:00 - Logout succeed code:
2019-10-19T18:57:46+01:00 - Error: Invalid attribute name
Line: 0
Column: 1205
Char: '
2019-10-19T18:57:46+01:00 - Logged out, error:

Is there any solution about that? What am I doing wrong?

Annaeiros avatar Oct 19 '19 18:10 Annaeiros

It seems like an error in your JSON file specifying the class to book but difficult to say with this error logs.

alex3165 avatar Oct 22 '19 17:10 alex3165

@alex3165 I had the same issue and I find out is because of the class Reppin'. That ' messes up cheerio.load and you end up having invalid attributes.

Check this PR #11

crazyKey avatar Nov 02 '19 09:11 crazyKey

@crazyKey I don't think this is correct. I tried with Bike & Beats and had the same problem.

tmerlet avatar Nov 03 '19 21:11 tmerlet

if you want to book the reppin class, you need to use "Reppin’" as the class name

tmerlet avatar Nov 03 '19 21:11 tmerlet

I didn't explain it properly, sorry.

@tmerlet I didn't try to book Reppin'. This issue doesn't have anything to do with the class name you're trying to book.

It's the name of the class in the timetable the bot downloads which causes issues.

the href in the page is href='....Reppin'' so cheerio.load converts it to href="...Reppin"" and this makes it give the invalid attribute name.

crazyKey avatar Nov 03 '19 22:11 crazyKey

@tmerlet just checked your pr, we fixed the same thing in two different ways :)

Your fix is more reliable, for example, if they'll decide to rename another class e.g. Pullin', mine would break it as it just replaces Reppin'

crazyKey avatar Nov 03 '19 22:11 crazyKey

Ah I see @crazyKey, thanks for the clarification :-) 👍

tmerlet avatar Nov 03 '19 22:11 tmerlet