![]() |
How to save results in .csv file?
Hello,
I have this working script and I would like to save those results in csv. Can anyone help me how to do that? PHP Code:
|
Which data are you trying to get ...
title? price? ? And are you OK with only grabbing the first 50 results? You can specify page, but the number per page is 50. It looks like there are 10 pages ... about 500 in total? . |
Hello Mlseim- thank you for your reply.
It would be great only to save urls of those products which script generates (those urls which starts with "http://www.ebay.com/itm/") .... I think I can handle from which page it would take products. Thank you for your help- I really appreciate it! |
Upload the script below and see what happens.
That might give you a nice start on it. If that script yields good results, you can tweak it and work on the csv part. PHP Code:
Just something I remembered that I had in my pile of snippets. The key to the script, is the fact that all descriptions are contained in this tag: <div class="ittl"> blah blah blah </div> . |
Thank you, that was easier than my script...:thumbsup:
|
The CSV part is a matter of creating a new file (open a file for writing, such as "ebay.csv"), and then looping through the array and writing each line to that file. Each line is followed by a carriage return. If there are more than one thing for each line, such as title and price, they would be separated by a comma ... but caution used if commas are part of your item title. You need to choose the best delimiter.
|
| All times are GMT +1. The time now is 01:19 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.