# Scrape to single CSV instead of separate TXTs?

**URL:** <https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323>\
**Category:** support\
**Tags:** dynamic-scraper\
**Created:** [June 9, 2024, 8:38am UTC](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323 "2024-06-09T08:38:53Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![scrap3r](https://forum.seocontentmachine.com/letter_avatar_proxy/v4/letter/s/b5e925/32.png) [@scrap3r](https://forum.seocontentmachine.com/u/scrap3r)\
**Post date:** [June 9, 2024, 8:38am UTC](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323/1 "2024-06-09T08:38:53Z")

</div>

The static scraper only allows scraping website content to individual TXT files or one large TXT file. However, to further process the scraped data, I want it in a CSV/Google Sheet with one row for each URL, like column A = URL and column B = scraped content. How can this be achieved?

---

<div class="post-metadata">

**Author:** ![Tim](https://forum.seocontentmachine.com/user_avatar/forum.seocontentmachine.com/tim/32/486_2.png) [@Tim](https://forum.seocontentmachine.com/u/Tim)\
**Post date:** [June 10, 2024, 12:33am UTC](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323/2 "2024-06-10T00:33:37Z")

</div>

The static scraper doesn’t have CSV or Google spreadsheet support right now.

You could do it using the Dynamic scraper instead

eg:

 ![image](https://forum.seocontentmachine.com/uploads/default/original/1X/acfb78c820dccf626677be911eebb8af6d62c43b.png)

Selectors are:

 ![image](https://forum.seocontentmachine.com/uploads/default/original/1X/b9b9675e35a42e8b1518a744425c82c2c757096e.png)

Project sample

[title body csv.zip](https://forum.seocontentmachine.com/uploads/short-url/wBqZs1vuBhTHyrtTe0xeoGKi5Es.zip) (1.7 KB)

---

<div class="post-metadata">

**Author:** ![scrap3r](https://forum.seocontentmachine.com/letter_avatar_proxy/v4/letter/s/b5e925/32.png) [@scrap3r](https://forum.seocontentmachine.com/u/scrap3r)\
**Post date:** [June 10, 2024, 7:52am UTC](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323/3 "2024-06-10T07:52:49Z")

</div>

I did not think of that - thank you!

---

<div class="post-metadata">

**Author:** ![Tim](https://forum.seocontentmachine.com/user_avatar/forum.seocontentmachine.com/tim/32/486_2.png) [@Tim](https://forum.seocontentmachine.com/u/Tim)\
**Post date:** [June 11, 2024, 7:07am UTC](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323/4 "2024-06-11T07:07:33Z")

</div>

Let me know how it goes.

Also if the Google export works fine as well

---

<div class="post-metadata">

**Author:** ![scrap3r](https://forum.seocontentmachine.com/letter_avatar_proxy/v4/letter/s/b5e925/32.png) [@scrap3r](https://forum.seocontentmachine.com/u/scrap3r)\
**Post date:** [June 11, 2024, 10:16am UTC](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323/5 "2024-06-11T10:16:16Z")

</div>

Initial feedback:

1. I use innerText with body selector because “detect article” skips too much of the content I need. The result is a broken CSV unfortunately, I guess because of the quotes + commas + semicolons inside the scraped content which results in new rows. I’m currently testing this with Google Sheets output, but seeing that it first writes everything into a CSV as well instead of an XLSX or something, I assume I’ll run into the same issue. **Edit:** yes, same issue. While the Google export does work fine, I end up with way more rows than input URLs because depending on the scraped content it creates a new row.

2. I can’t figure out how to have the input URL in column A of the output file and the scraped content for that URL in column B. This is to be able to later merge the scraped data into existing sheets by matching the URLs within the existing sheets to parse the scraped content into the correct rows.

---

<div class="post-metadata">

**Author:** ![Tim](https://forum.seocontentmachine.com/user_avatar/forum.seocontentmachine.com/tim/32/486_2.png) [@Tim](https://forum.seocontentmachine.com/u/Tim)\
**Post date:** [June 11, 2024, 3:18pm UTC](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323/6 "2024-06-11T15:18:37Z")

</div>

Can you export the project task for me?

I will have a closer look into it.

---

<div class="post-metadata">

**Author:** ![scrap3r](https://forum.seocontentmachine.com/letter_avatar_proxy/v4/letter/s/b5e925/32.png) [@scrap3r](https://forum.seocontentmachine.com/u/scrap3r)\
**Post date:** [June 11, 2024, 3:36pm UTC](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323/7 "2024-06-11T15:36:32Z")

</div>

I’ve sent the export via DM.

P.S. [Point 2](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323/5) might be something you may have an answer to

---

<div class="post-metadata">

**Author:** ![scrap3r](https://forum.seocontentmachine.com/letter_avatar_proxy/v4/letter/s/b5e925/32.png) [@scrap3r](https://forum.seocontentmachine.com/u/scrap3r)\
**Post date:** [June 19, 2024, 12:19pm UTC](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323/8 "2024-06-19T12:19:01Z")

</div>

@Tim Any update regarding the broken output?

---

<div class="post-metadata">

**Author:** ![Tim](https://forum.seocontentmachine.com/user_avatar/forum.seocontentmachine.com/tim/32/486_2.png) [@Tim](https://forum.seocontentmachine.com/u/Tim)\
**Post date:** [June 20, 2024, 6:52am UTC](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323/9 "2024-06-20T06:52:03Z")

</div>

I added some CSV escaping,

So all the text appears inside " " and any quotes etc are escaped as " in the text.

Re multilines, normally its a setting you might have to enable to allow line breaks inside csv cols.

AFAIK it should work fine in Google as it allows multiple lines in each cell.

Can you re run project with new update and let me know what has changed?

---

<div class="post-metadata">

**Author:** ![scrap3r](https://forum.seocontentmachine.com/letter_avatar_proxy/v4/letter/s/b5e925/32.png) [@scrap3r](https://forum.seocontentmachine.com/u/scrap3r)\
**Post date:** [June 21, 2024, 3:33pm UTC](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323/10 "2024-06-21T15:33:36Z")

</div>

@Tim still no luck unfortunately - the CSV is still “broken” whether I open it locally with (I tried various settings) or import it into Google Sheets - same results just that some quotation marks are now escaped.

---

<div class="post-metadata">

**Author:** ![Tim](https://forum.seocontentmachine.com/user_avatar/forum.seocontentmachine.com/tim/32/486_2.png) [@Tim](https://forum.seocontentmachine.com/u/Tim)\
**Post date:** [June 21, 2024, 6:04pm UTC](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323/11 "2024-06-21T18:04:36Z")

</div>

Can you give some screenshots of what error looks like?

---

<div class="post-metadata">

**Author:** ![Tim](https://forum.seocontentmachine.com/user_avatar/forum.seocontentmachine.com/tim/32/486_2.png) [@Tim](https://forum.seocontentmachine.com/u/Tim)\
**Post date:** [June 21, 2024, 6:05pm UTC](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323/12 "2024-06-21T18:05:17Z")

</div>

Also you should export to google sheets directly and not via csv

---

<div class="post-metadata">

**Author:** ![scrap3r](https://forum.seocontentmachine.com/letter_avatar_proxy/v4/letter/s/b5e925/32.png) [@scrap3r](https://forum.seocontentmachine.com/u/scrap3r)\
**Post date:** [June 21, 2024, 7:32pm UTC](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323/13 "2024-06-21T19:32:28Z")

</div>

@Tim I just DM’d you the CSV file that SCM created so you can analyze it. I’ll try direct Google Sheets export tomorrow and update you.

---

<div class="post-metadata">

**Author:** ![Tim](https://forum.seocontentmachine.com/user_avatar/forum.seocontentmachine.com/tim/32/486_2.png) [@Tim](https://forum.seocontentmachine.com/u/Tim)\
**Post date:** [June 22, 2024, 6:43pm UTC](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323/14 "2024-06-22T18:43:23Z")

</div>

Error found in the CSV append to file code.

It was removing some lines causing the " formatting to break.

Its been fixed in newest update

Please test it

---

<div class="post-metadata">

**Author:** ![scrap3r](https://forum.seocontentmachine.com/letter_avatar_proxy/v4/letter/s/b5e925/32.png) [@scrap3r](https://forum.seocontentmachine.com/u/scrap3r)\
**Post date:** [June 23, 2024, 8:47am UTC](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323/15 "2024-06-23T08:47:17Z")

</div>

@Tim This did not fix the bug unfortunately. I just DM’d you the CSV that the SCM version with “fix: Dynamic scraper, csv output append to file corrupting output” created.

Edit: Sorry, it’s fixed! I didn’t delete the old CSV and re-running the project didn’t overwrite it. So what I was looking at was the data from the previous run with the previous SCM version…

---

<div class="post-metadata">

**Author:** ![Tim](https://forum.seocontentmachine.com/user_avatar/forum.seocontentmachine.com/tim/32/486_2.png) [@Tim](https://forum.seocontentmachine.com/u/Tim)\
**Post date:** [June 23, 2024, 9:07am UTC](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323/16 "2024-06-23T09:07:29Z")

</div>

Lovely all fixed right?

---

<div class="post-metadata">

**Author:** ![scrap3r](https://forum.seocontentmachine.com/letter_avatar_proxy/v4/letter/s/b5e925/32.png) [@scrap3r](https://forum.seocontentmachine.com/u/scrap3r)\
**Post date:** [June 23, 2024, 11:49am UTC](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323/17 "2024-06-23T11:49:58Z")

</div>

@Tim I was wrong about being wrong! 😃 It’s not fixed for my particular project at least. DM’d you the file.

---

<div class="post-metadata">

**Author:** ![Tim](https://forum.seocontentmachine.com/user_avatar/forum.seocontentmachine.com/tim/32/486_2.png) [@Tim](https://forum.seocontentmachine.com/u/Tim)\
**Post date:** [June 23, 2024, 5:48pm UTC](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323/18 "2024-06-23T17:48:12Z")

</div>

I did a new update to change the " escape to " " , which on my testing worked better

---

<div class="post-metadata">

**Author:** ![scrap3r](https://forum.seocontentmachine.com/letter_avatar_proxy/v4/letter/s/b5e925/32.png) [@scrap3r](https://forum.seocontentmachine.com/u/scrap3r)\
**Post date:** [June 24, 2024, 11:09am UTC](https://forum.seocontentmachine.com/t/scrape-to-single-csv-instead-of-separate-txts/323/19 "2024-06-24T11:09:35Z")

</div>

@Tim Fix confirmed! Thank you!!! 🙂
