Getting parent element's attribute

Hey guys!

Because prices are rising quickly, I am making a web scraper that scrapes supermarket product prices.
To catagorize and store these items I need their data-product-id ( so I can sort them myself)

The data-product-id is an attribute of the parent element ( like a product container ) . When I try to scrape with the setup in the root folder it works, but when i move it to the element-wrapper it stops working.

It looks like the issue is that the element which has the attribute is the same element as the element wrapper.

I'd like to have some help!

Thank you.


I Managed to pull it off using the parent element to get the attribute from inside the element-wrapper