gymbox-bot
gymbox-bot copied to clipboard
Issue with running the CLI program
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?
It seems like an error in your JSON file specifying the class to book but difficult to say with this error logs.
@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 I don't think this is correct. I tried with Bike & Beats and had the same problem.
if you want to book the reppin class, you need to use "Reppin’" as the class name
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.
@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'
Ah I see @crazyKey, thanks for the clarification :-) 👍