Problem with csv generated after


#1

Hi, i’m trying to get data from website and save it into a csv file, but the csv output is :

when scraping the webpage the shown datatable is OK, but the csv is not OK?!


#2

Scraped data has line breaks between actual price and trending price, so when you export to .csv it goes to next line - and Excel treats each line as a row, it doesn’t care for quotes etc.

You could try replacing the line breaks with a space or splitting the column in other fashion.


#3

how to do that, i’m using dataa scaping?!

also when i lunch my workflow, IE does not open, i open it manually!!!


#4
foreach (DataRow row in dt.rows)
{
    row("Price") = row("Price").ToString().Replace(Environment.NewLine, " ");
}

You need to add an OpenBrowser activity to make IE be opened by the robot.

I’d suggest going through the Academy (if you’re not doing it already) as well.


#5

test.xaml (13.8 KB)

@abdel

Please try using the attached workflow, and verify if it works.


#6

Thank you Gourav,

Now it works but the csv file is still not OK


#7

how you insert that in a sequence


#8

I’ve seen this before but not sure how to resolve it. A trick that you might try as a workaround to your issue is to define the separator at the top of the CSV data string
for example:

sep=,
a,b,c,d,e,f
g,h,i,j,k,l

“sep=,” tells Excel to use comma as the separator.


#9

Use a For Each/For Each Row activity for the loop.
The assign inside is just a simple Assign activity (omit the semicolon at the end).


#10

i had tryed this,

webscrapping.xaml (11.0 KB)

but always some csv