Giglium / vinted_scraper

A very simple Python package that scrapes the Vinted website to retrieve information about its items.
MIT License
15 stars 3 forks source link

Script tag `{'data-component-name': 'ItemDetails'}` not found. #12

Closed FRC-95 closed 11 months ago

FRC-95 commented 11 months ago

Describe the bug

Some Vinted website components had changed, including 'data-component-name': 'ItemDetails'

Steps to reproduce

The _parse_html functions fails (at line 61) because the attrs 'data-component-name': 'ItemDetails' does not longer exist in Vinted website.

Expected behavior

I'm not an HTML expert, but there doesn't seem to be a tag that directly replaces ItemDetails.

Giglium commented 11 months ago

Hi, you are right they have changed the structure. I've rerun the tests and now they fail.

I've checked their source code and the tag <script type="application/json" data-component-name="ItemDetails"> is missing from the item page. Fortunately, the search is still working.

I will come back at the end of next week to fix it since now I am on holiday.

Giglium commented 11 months ago

Hi, I've fixed the problem in a quick and dirt way. Since the new solution required the API I preferred to implement a quick fix and start rewriting my code to be API-based.

The new API-based approach (#13) will be a breaking change, I hope it will require a little effort to implement.