Jump to content
UBot Underground

Recommended Posts

Guys i have an issue i don't know why does my CSV file contain Line Breaks?

This is the script for scraping so what did i do wrong?

 

This all started happening few days ago when i Reinstalled my Windows 7 so i don't know what did i do wrong!

Once this script is done i get a File which is attached so you can take a look

 

Usually when i scrape some info i import it into excel and immediately my Excel starts its Importing wizard but Excel is treating this like a simple txt file and i made sure inside the script it has to be saved as a CSV file!

 

So what is my mistake?

 

 

EDIT: I added my Debugger Image so you can see how the data looks like in there so i don't understand this issue???

 

Any Ideas??

 

loop($list total(%Linkovi)) {
    navigate("http://www.walgreens.com{$next list item(%Linkovi)}","Wait")
    set(#product name,$scrape attribute(<itemprop="name">,"innertext"),"Global")
    set(#Price,$scrape attribute(<id="vpdSinglePrice">,"innertext"),"Global")
    wait for browser event("Page Loaded","")
    wait for browser event("Everything Loaded","")
    wait for browser event("DOM Ready","")
    set table cell(&Wallgreens,0,0,"PRODUCT NAME")
    set table cell(&Wallgreens,0,1,"PRODUCT PRICE")
    set table cell(&Wallgreens,#row,0,#product name)
    set table cell(&Wallgreens,#row,1,#Price)
    increment(#row)
    comment("Clean Up Table")
    set(#Row,0,"Global")
    loop($table total rows(&Wallgreens)) {
        set(#Col,0,"Global")
        loop($table total columns(&Wallgreens)) {
            if($comparison($table cell(&Wallgreens,#Row,#Col),"=","")) {
                then {
                    set table cell(&Wallgreens,#Row,#Col,"Priced Per Store")
                }
                else {
                }
            }
            increment(#Col)
        }
        increment(#Row)
    }
    save to file("{$special folder("Desktop")}\\Walgreens.csv",&Wallgreens)
}

Walgreens.csv

post-18544-0-69961200-1420979495_thumb.jpg

Link to post
Share on other sites

You could try using $trim to remove trailing blank spaces - not sure it will remove a line break though:

set(#product name,$trim($scrape attribute(<itemprop="name">,"innertext")),"Global")
Link to post
Share on other sites

Hey man it worked no more line breaks in this instance so thanks for that now the other Excel problem.

 

My Excel treats this file like its a txt File Instead of CSV file now why is that?

 

EDIT: I just noticed my File gets saved as ANSI Format instead of UTF-8 can i change that when Ubot saves the file?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...