Fllorent0D / ha-custom-component-sodexo-be

Sodexo Be - Custom Component for Home Assistant
MIT License
3 stars 1 forks source link

Pluxee #5

Open ivonulens opened 5 months ago

ivonulens commented 5 months ago

Hello

Sodexo ammount is not more showing, is this becouse it changed from Sodexo To Pluxee

bugzke commented 5 months ago

Certainly seems that way. This integration scrapes the information from the website, and their website changed.

In the integration code I notice

LOGIN_URL = "https://sodexo4you.be/fr"
LUNCH_PASS_SELECTOR = "body > header > div.header-fixed > div.balance-block > div > ul > li.lunch-pass > a > span.balance_price"
ECO_PASS_SELECTOR = "body > header > div.header-fixed > div.balance-block > div > ul > li.eco-pass > a > span.balance_price"
GIFT_PASS_SELECTOR = "body > header > div.header-fixed > div.balance-block > div > ul > li.cadeau-pass > a > span.balance_price"

However, when looking at the source code of the new website design, the HTML is different. So probably why it doesn't update anymore.

It looks like this for e.g. the lunch pass: body > div > header > div.header-fixed > div.balance-block > div > ul > li > a > span.balance--price" image

Not quite sure though how to get the data without the class in the li element indicating what type the balance is referring to. It's in the a href attribute, but I don't know how this integration should be adjusted to work with that.

@Fllorent0D can you help with this?