Grabing photos and item descriptions in ebay

Free BrownRecluse scripts provided by SoftByte Labs and users. To use, copy the script and paste it in the BrownRecluse script editor. Modify to your need, save and run.
Post Reply
Kasper
Posts: 7
Joined: Mon Feb 20, 2012 9:14 am

Grabing photos and item descriptions in ebay

Post by Kasper » Mon Feb 20, 2012 9:22 am

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,

User avatar
Support
Site Admin
Posts: 1821
Joined: Sun Oct 02, 2011 10:49 am

Re: Grabing photos and item descriptions in ebay

Post by Support » Mon Feb 20, 2012 8:36 pm

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.
http://SoftByteLabs.com

Kasper
Posts: 7
Joined: Mon Feb 20, 2012 9:14 am

Re: Grabing photos and item descriptions in ebay

Post by Kasper » Tue Feb 21, 2012 4:30 am

Yes, that's correct. Thanks for your help.

Kasper
Posts: 7
Joined: Mon Feb 20, 2012 9:14 am

Re: Grabing photos and item descriptions in ebay

Post by Kasper » Wed Feb 22, 2012 1:23 am

By the way, can I have the script for that?

Thanks

User avatar
Support
Site Admin
Posts: 1821
Joined: Sun Oct 02, 2011 10:49 am

Re: Grabing photos and item descriptions in ebay

Post by Support » Wed Feb 22, 2012 10:44 am

I'm working on it.
Your support team.
http://SoftByteLabs.com

User avatar
Support
Site Admin
Posts: 1821
Joined: Sun Oct 02, 2011 10:49 am

Re: Grabing photos and item descriptions in ebay

Post by Support » Wed Feb 22, 2012 1:13 pm

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.
http://SoftByteLabs.com

Kasper
Posts: 7
Joined: Mon Feb 20, 2012 9:14 am

Re: Grabing photos and item descriptions in ebay

Post by Kasper » Sat Feb 25, 2012 11:31 pm

Thanks very much for your help. I have tested it and it is really amazing.

Post Reply