This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Last revision Both sides next revision | ||
tesco_scraper [2022/05/02 15:26] admin |
tesco_scraper [2022/05/02 15:32] 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> |