Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seller rating text on amazon.de's seller pages seems to be A/B tested currently (?) so the regex to extract the rating doesn't always work #23

Open
tadwohlrapp opened this issue Jun 19, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@tadwohlrapp
Copy link
Owner

Problem description

Example of familiar rating text:

image

https://www.amazon.de/sp?seller=A2N0PAQ62QEUZ

New text discovered today:

image

https://www.amazon.de/sp?seller=A3VZ5OB3NSI4Z8

Current regex to extract positive rating percentage and number of ratings on amazon.de:

/(\d+ %).*?\((\d+)/

For the above example the regex captures 95 % positive Bewertungen in den letzten 12 Monaten (154 with the two groups 95 % and 154.

Seems like it should be extended to also capture text like 100% positiv Lebensdauer (4 Gesamtbewertungen) (which by the way reads very weird in German...)

Amazon Link

https://www.amazon.de/sp?seller=A3VZ5OB3NSI4Z8

SoldBy Version

1.7.1

Browser

Brave

Userscript manager

Violentmonkey

@tadwohlrapp tadwohlrapp added the bug Something isn't working label Jun 19, 2023
@tadwohlrapp
Copy link
Owner Author

Updating the regex itself is not the real issue (/(\d+ ?%).*?\((\d+)/ would work just fine), but currently the percentage gets stored as a string containing the percentage sign itself.

Simply adding a ? to the space between the number and the percentage sign to make it optional would result in a mix of stored 90 % and 90% scores.

Rather the % should be omitted completely from storage and only added when rendering the scores.

We will need a solution which doesn't break already stored values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant