Hi,
I am trying to find a particular item "silk tie" in ebay.com and wish to generate a list of which have the item numbers, seller ID and also grap the item photos to C:\finditem\tie\. In that way, I can save time from clicking each searched pages one by one. Could you help me in preparing that script?
Thanks and Regards,
Grabing photos and item descriptions in ebay
Re: Grabing photos and item descriptions in ebay
ok. so you need a script that will search for "something" and for each items displayed, you need to download all the photos for that item, and save the item number and seller ID. In other words, build a text file with the item number, seller ID amd picture(s) name one line per item, all fileds tab delimited?
Your support team.
https://SoftByteLabs.com
https://SoftByteLabs.com
Re: Grabing photos and item descriptions in ebay
Yes, that's correct. Thanks for your help.
Re: Grabing photos and item descriptions in ebay
By the way, can I have the script for that?
Thanks
Thanks
Re: Grabing photos and item descriptions in ebay
I'm working on it.
Your support team.
https://SoftByteLabs.com
https://SoftByteLabs.com
Re: Grabing photos and item descriptions in ebay
Here is the script. Just change the first line to whatever keywords you want to search for. The tab delimited file will be saved as ebay.txt in the same folder as this script, and the pictures will be saved in the images folder also in the same folder as this script. The first field is the seller ID, then the item number, then the image file name...
Code: Select all
Keywords = 'silk tie';
PerlRegEx = Yes;
Output.Clear;
Link = New(URL);
temp = New(URL);
rx = New(RegEx);
sx = New(RegEx);
F = New(File);
D = New(File);
D.Open(ScriptPath+'ebay.txt');
D.Truncate;
Keywords.Replace('\s', '+');
NextPage = 'http://www.ebay.com/sch/i.html?_nkw='+Keywords+'&_ipg=200&_sacat=See-All-Categories';
while NextPage do begin
Link.Get(NextPage);
NextPage = Decode(WildGet(Link.Data, '<a href="([^"]+_pgn=\d+)"[^>]*><i>Next</i>'));
if NextPage then NextPage = Link.FixUp(NextPage);
rx.Data = Link.Data;
rx.Mask = '<a title="[^"]*" href="([^"]+)" class="[^"]*" r="[^"]*" _sp="[^"]*">';
rx.Reset;
while rx.Match do begin
lnk = Link.FixUp(Decode(rx.Value[1]));
ItemNumb = WildGet(lnk, '/itm/[^/]+/([^\?]+)');
temp.Get(lnk);
SellerID = WildGet(temp.Data, '<a\s+title="Member\s+id\s+([^"]+)"');
sx.Data = temp.Data;
sx.Mask = 'image"\s+content="([^"]+\.jpg)"';
sx.Reset;
if sx.Match then begin
lnk = Decode(sx.Value[1]);
DecodeURL(lnk, [imgID], [FileName]);
imgID.Replace('\*', '');
imgID.Replace('\|', '');
imgID.Replace('\\', '');
imgID.Replace('\/', '');
imgID.Replace('\:', '');
imgID.Replace('\"', '');
imgID.Replace('\<', '');
imgID.Replace('\>', '');
imgID.Replace('\?', '');
imgID.Replace('\$', '');
temp.Get(lnk);
F.Open(ScriptPath+'images\'+imgID);
F.Write(temp.Data);
F.Close;
end else
imgID = '';
DataLine = SellerID +tab+ ItemNumb +tab+ imgID;
Output(DataLine);
D.Write(DataLine+crlf);
end;
end;
D.Close;
Your support team.
https://SoftByteLabs.com
https://SoftByteLabs.com
Re: Grabing photos and item descriptions in ebay
Thanks very much for your help. I have tested it and it is really amazing.