How to extract data without break lines?

Find a consultant or advertise your services here
Post Reply
bfdxi
Posts: 7
Joined: Wed Jun 19, 2013 12:07 pm

How to extract data without break lines?

Post by bfdxi » Mon Jun 24, 2013 7:43 am

I fetch a data from here:

Code: Select all

http://www.bestbuy.com/site/olstemplatemapper.jsp?_dyncharset=ISO-8859-1&_dynSessConf=5242784900518619985&id=pcat17080&type=page&lcn=TV+%26+Home+Theater&sc=TVVideoSP&st=processingtime%3A%3E1900-01-01&usc=abcat0100000&cp=1&sp=-bestsellingsort+skuid&nrp=60&qp=cabcat0100000%23%230%23%23wv~~cabcat0101000%23%23-1%23%23wv~~q466173746c696d69747067735f323236~~nf519||24323030202d20243234392e3939&add_to_pkg=false&pagetype=listing&gf=y
And I use .js to fetch them following:

Code: Select all

var GetFx;
var jsLF = "\n";

macro2 ="CODE:";
macro2 += "SET !ERRORIGNORE YES"	+ jsLF;
macro2 += "SET !ERRORCONTINUE YES" +	jsLF;
macro2 += "SET !EXTRACT_TEST_POPUP NO" +	jsLF;

pagenumber= 1000;
startpage = 1;

while(startpage < pagenumber)
{

for(i=1;i<=50;i++){
macro2 += "TAG POS="+ i +" TYPE=IMG ATTR=class:thumb* EXTRACT=HREF" + jsLF;
macro2 += "TAG POS="+ i +" TYPE=H3 ATTR=itemprop:name* EXTRACT=TXT" + jsLF;
macro2 += "TAG POS="+ i +" TYPE=A ATTR=itemprop:url* EXTRACT=HREF" + jsLF;
macro2 += "SAVEAS TYPE=EXTRACT FOLDER=* FILE=test.csv" + jsLF;
}
macro2 += "TAG POS=1 TYPE=A ATTR=TXT:Next<SP>Page"   + jsLF;
GetFx = iimPlay(macro2);
}
macro2 += "CLEAR" +	jsLF;
And this is a result of class h3 itemprop=name has a multiple break lines following:

Code: Select all

"





Dynex™ - 32"" Class (31-1/2"" Diag.) - LCD - 720p - 60Hz - HDTV"
So, I want a help for someone to suggest me about deleting multiple break lines before "Dynex..."

Thank you for someone helps.
janib4all
Posts: 132
Joined: Wed Jul 21, 2010 6:44 am
Location: Karachi, Sindh, Pakistan
Contact:

Re: How to extract data without break lines?

Post by janib4all » Mon Jul 22, 2013 8:37 am

Use java script .match() function to replace all NEW_LINES to (\n) and later search this term.
Hire the BoT-fReeak!
botspecialist.blogspot.com
Post Reply