GoogleChromeLabs / GoogleChromeLabs/table-scrape

Table cells containing quotes and commas can produce a malformed csv

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
11
Forks
0
PR merge metrics
No merged PRs in 30d

Description

We are using this plugin to scrape shared drive data from the Google Workspace admin console and have found that when shared drive names contain both double quotes (") and commas we end up with a malformed csv as the double quotes are not properly escaped.

Updating https://github.com/GoogleChromeLabs/table-scrape/blob/main/contentscript.js#L166 to the following resulted in a valid csv but may not be the best approach:

`const text = '"' + column.innerText.replaceAll('"', '""') + '"'`

Let me know your thoughts - I can submit that as a PR if it looks fine to you. Thank you!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.