itexspert 47 Posted January 20, 2015 Report Share Posted January 20, 2015 Guys this is my issue in Ubot when scraping something i noticed that when you scrape addresses lets say one address is St. 34, Alesandra Avenue Scraping is fine and It will fill one column in Excel and i am ok with that butWhat about long strings lets say address is Street 34.Allesandra Avenue New York Department,Ministry of defense,local directory......bla,bla,bla In these cases Ubot automatically goes into new line and ruins my data my question is this: Is there a way to Limit how many informations Script scrapes from a particular string?Is there a way to force Ubot to keep everything in 1 line regardless of the amount of data in one string? So my goal is thisRegardless if the Address is Looong or Short Ubot MUST keep everything in one single line until variable increments the line! I am working on a new thing and this is my issue if anyone can help please do! Quote Link to post Share on other sites
dyvel 20 Posted January 20, 2015 Report Share Posted January 20, 2015 It would be easier to help if you posted some of your code and perhaps a screenshot from the debugger illustrating the problem. Quote Link to post Share on other sites
itexspert 47 Posted January 20, 2015 Author Report Share Posted January 20, 2015 Scraping Code is simple but see attached in my debugger you can see line breaks even though i trim trailing spaces and still this happens in my excel (See attached pictures) That is my issue there are line breaks and i cant fix it! wait for browser event("Everything Loaded",3) set table cell(&Scraped,#row,0,$trim($scrape attribute(<itemprop="name">,"innertext"))) set(#adresa,$replace($trim($scrape attribute(<itemprop="address">,"innertext"))," - View Map",""),"Global") set table cell(&Scraped,#row,1,#adresa) set(#phone,$trim($scrape attribute(<rel="mainPhone">,"innertext")),"Global") set(#phone,$replace(#phone,"Phone:",""),"Global") set table cell(&Scraped,#row,2,#phone) set table cell(&Scraped,#row,3,$trim($scrape attribute(<rel="businessCategories">,"innertext"))) set table cell(& Scraped,#row,4,$trim($scrape attribute(<itemprop="foundingDate">,"innertext"))) set table cell(&Scraped,#row,5,$trim($scrape attribute(<rel="numEmployees">,"innertext"))) set(#email,$trim($scrape attribute(<itemprop="email">,"innertext")),"Global") set(#email,$replace(#email,"Email:",""),"Global") set table cell(&Scraped,#row,6,#email) set table cell(&Scraped,#row,7,$trim($scrape attribute(<itemprop="faxNumber">,"innertext"))) set table cell(&Scraped,#row,8,$trim($scrape attribute(<rel="annualRevenue">,"innertext"))) set table cell(&Scraped,#row,9,$trim($scrape attribute(<rel="locationType">,"innertext"))) set table cell(&Scraped,#row,10,$trim($scrape attribute(<rel="sicDetails">,"innertext"))) set table cell(&Scraped,#row,11,$trim($scrape attribute(<rel="naicsDetails">,"innertext"))) set table cell(&Scraped,#row,12,$trim($scrape attribute(<outerhtml=w"<span class=\"text-primary\" itemprop=\"name\">*</span>">,"innertext"))) run javascript("location.reload(true);") wait(0.5) save to file("{$special folder("Desktop")}\\details.csv",&Scraped) increment(#row) Quote Link to post Share on other sites
arunner26 51 Posted January 20, 2015 Report Share Posted January 20, 2015 itexspert,You want to use the UBOT REPLACE command to replace the $NEWLINE with a space for the columns that wrap. Quote Link to post Share on other sites
itexspert 47 Posted January 20, 2015 Author Report Share Posted January 20, 2015 itexspert,You want to use the UBOT REPLACE command to replace the $NEWLINE with a space for the columns that wrap.Can you give me like an example code i never had to do that? Quote Link to post Share on other sites
arunner26 51 Posted January 20, 2015 Report Share Posted January 20, 2015 itexspert,From a BOT I am currently using: set(#AnswerText, $replace(#AnswerText, $new line, " "), "Global") Quote Link to post Share on other sites
itexspert 47 Posted January 20, 2015 Author Report Share Posted January 20, 2015 Thanks man will try Quote Link to post Share on other sites
itexspert 47 Posted January 21, 2015 Author Report Share Posted January 21, 2015 Ok another question this code worked i adapted it now i have another problem sometimes when scraping e-mails there are more than one mail and then they append together like this In Normal site this is now mails are shown ghta@gmx.comkonj@gmail.comharoo@yahoo.com Now when i scrape it they look like this ghta@gmx.comkonj@gmail.comharoo@yahoo.com So How do i Put Spaces just to space these E-mails or put them in a row without breaking Lines in Excel? Quote Link to post Share on other sites
HelloInsomnia 1103 Posted January 22, 2015 Report Share Posted January 22, 2015 They look like that in Excel or they are scraping like that in Ubot? Quote Link to post Share on other sites
itexspert 47 Posted January 22, 2015 Author Report Share Posted January 22, 2015 they show line breaks,not to worry arunner26 was a big help on this issue so far it works fairly good! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.