Product review data from single page in multiple rows

Describe the problem.

Is it possible to scrape product review data for a produce (product name, date, review title, review rating, review comments) and put each review in a new row.

Spent a few days trying to work this out, really struggling.

Url: https://www.tesco.com/groceries/en-GB/products/254945610

Sitemap:
https://www.tesco.com/groceries/en-GB/zone/sitemap/

All help greatly appreciated!!!
{id:"sitemap code"}

Hi,

Yes, you can return each review in a new row by creating a wrapper element. Please see below a reference sitemap:

{"_id":"tesco-com-reviews","startUrl":["https://www.tesco.com/groceries/en-GB/products/254945610"],"selectors":[{"elementLimit":0,"id":"scroll","multiple":true,"parentSelectors":["_root"],"scroll":true,"selector":"body","type":"SelectorElement"},{"id":"pagination","paginationType":"clickMore","parentSelectors":["_root","pagination"],"selector":"a:contains('Show 10 more reviews')","type":"SelectorPagination"},{"elementLimit":0,"id":"review-wrapper","multiple":true,"parentSelectors":["pagination"],"scroll":false,"selector":"[data-auto=\"review-container\"] hr ~ div:has(hr)","type":"SelectorElement"},{"id":"review-title","multiple":false,"multipleType":"singleColumn","parentSelectors":["review-wrapper"],"regex":"","selector":"div.sLLuoU83bVVQdPT","type":"SelectorText"},{"id":"review-body","multiple":false,"multipleType":"singleColumn","parentSelectors":["review-wrapper"],"regex":"","selector":"div.rBSFtRFU2q0Wob6","type":"SelectorText"},{"id":"rating","multiple":false,"multipleType":"singleColumn","parentSelectors":["review-wrapper"],"regex":"","selector":"p.f58626_XrmOxq_hint","type":"SelectorText"},{"id":"date","multiple":false,"multipleType":"singleColumn","parentSelectors":["review-wrapper"],"regex":"","selector":"p:nth-of-type(2)","type":"SelectorText"}]}
1 Like

Amazing! Thank you.

How would I add product name into the scrape?

In example above its Tesco Wholemeal Pitta Bread 6 Pack

Had a go but struggling to sort.

Managed to work out product title :+1: last question.

If we wanted to pull back multiple product would we need separate site maps or can crear single site map with loafs product, for example if we wanted reviews from
https://www.tesco.com/groceries/en-GB/products/254945610

And

https://www.tesco.com/groceries/en-GB/products/292885006?_gl=1dztzsw_upMQ.._gaOTU2NjMzMDM3LjE3NTUyNTQ4NDA._ga_33B19D36CY*czE3NTUyNTQ4MzkkbzEkZzAkdDE3NTUyNTQ4NDYkajUzJGwwJGg

Both pages use same template

Thanks again, steep learning curve!

Resolved issue, you can add multiple URLS when you trigger scrape.

Thanks again, all sorted now, will have a play.

1 Like