User Tools

Site Tools


tesco_scraper

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tesco_scraper [2022/05/02 15:26]
admin
tesco_scraper [2022/05/02 15:38]
admin
Line 48: Line 48:
 } }
  
-$lines = array('​Product Name', 'Tesco URL', '​Brand',​ '​Price',​ 'Price per unit', 'Unit Measure'​);​+$lines ​= array(); 
 +$lines[] ​= array('​Product Name', 'Tesco URL', '​Brand',​ '​Price',​ 'Price per unit', 'Unit Measure'​);​
 // read through each of the pages, parse the json and output as csv // read through each of the pages, parse the json and output as csv
 echo "​Parsing JSON to CSV\n";​ echo "​Parsing JSON to CSV\n";​
Line 83: Line 84:
    ​fputcsv($fp,​ $line);    ​fputcsv($fp,​ $line);
 } }
 +
  
 </​code>​ </​code>​
Line 96: Line 98:
 Writing CSV Writing CSV
 </​code>​ </​code>​
 +
 +{{:​pasted:​20220502-153759.png}}
tesco_scraper.txt · Last modified: 2022/05/02 15:38 by admin