Problem with csv generated after

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?!

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.

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

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

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.

1 Like

test.xaml (13.8 KB)

@abdel

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

1 Like

Thank you Gourav,

Now it works but the csv file is still not OK

how you insert that in a sequence

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.

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).

i had tryed this,

webscrapping.xaml (11.0 KB)

but always some csv