This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
tesco_scraper [2022/05/02 15:26] admin |
tesco_scraper [2022/05/02 15:26] admin |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Tesco Scraper ====== | ====== Tesco Scraper ====== | ||
I threw this together one afternoon as I was frustrated that even though Tesco displays the 'price-per-ml' for things like cans and bottles of Coca Cola, it doesn't let you sort by 'price-per-ml'. So I wrote a quick script that will download an entire sub category of products, extract the data from them, then output them all to a CSV that I can filter/sort myself. | I threw this together one afternoon as I was frustrated that even though Tesco displays the 'price-per-ml' for things like cans and bottles of Coca Cola, it doesn't let you sort by 'price-per-ml'. So I wrote a quick script that will download an entire sub category of products, extract the data from them, then output them all to a CSV that I can filter/sort myself. | ||
+ | |||
+ | It was easier than I expected (I didn't have to do much scraping) as there is a data-element in the body tag of the page that has all the product detail in json format. | ||
<code php tesco-to-csv.php> | <code php tesco-to-csv.php> |