title: Writing a string with python in google sheets
body: <p>while building a webscraping python script I want to export the values in google sheets.</p>
  <p>However, when I try to write a string in google sheets I get the following error msg (see below).</p>
  <p>Code of the strings and google sheets write:</p>
  <pre><code>tags = [t.text for t in article.find('div', class_='tags').find_all('a')]
  content = [c.text for c in article.find('section', {&quot;class&quot;:&quot;content&quot;}).find_all('p')]
  
  data_sheets = [[news_outlet, category, headline, year, month, day, date, tags, content, [', '.join(sources_links) ], url_article, author]]
  
  request = sheet.values().append(spreadsheetId=SAMPLE_SPREADSHEET_ID, range=&quot;electrive!A2&quot;, valueInputOption=&quot;USER_ENTERED&quot;, body={&quot;values&quot;:data_sheets}).execute()
  </code></pre>
  <p>Output error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;/Users/XXX/Desktop/googlesheets&quot;, line 61, in &lt;module&gt;
      request = sheet.values().append(spreadsheetId=SAMPLE_SPREADSHEET_ID, range=&quot;electrive!A2&quot;, valueInputOption=&quot;USER_ENTERED&quot;, body={&quot;values&quot;:data_sheets}).execute()
    File &quot;/opt/homebrew/lib/python3.9/site-packages/googleapiclient/_helpers.py&quot;, line 131, in positional_wrapper
      return wrapped(*args, **kwargs)
    File &quot;/opt/homebrew/lib/python3.9/site-packages/googleapiclient/http.py&quot;, line 937, in execute
      raise HttpError(resp, content, uri=self.uri)
  googleapiclient.errors.HttpError: &lt;HttpError 400 when requesting https://sheets.googleapis.com/v4/spreadsheets/XXXX/values/electrive%21A2:append?valueInputOption=USER_ENTERED&amp;alt=json returned &quot;Invalid value at 'data.values[0]' (type.googleapis.com/google.protobuf.ListValue), &quot;electrive&quot;
  Invalid value at 'data.values[1]' (type.googleapis.com/google.protobuf.ListValue), &quot;Automobile&quot;
  Invalid value at 'data.values[2]' (type.googleapis.com/google.protobuf.ListValue), &quot;Environmental approval granted for Giga Berlin&quot;
  Invalid value at 'data.values[3]' (type.googleapis.com/google.protobuf.ListValue), &quot;2022&quot;
  Invalid value at 'data.values[4]' (type.googleapis.com/google.protobuf.ListValue), &quot;03&quot;
  Invalid value at 'data.values[5]' (type.googleapis.com/google.protobuf.ListValue), &quot;06&quot;
  Invalid value at 'data.values[6]' (type.googleapis.com/google.protobuf.ListValue), &quot;2022/03/06&quot;
  Invalid value at 'data.values[10]' (type.googleapis.com/google.protobuf.ListValue), &quot;https://www.electrive.com/2022/03/06/environmental-approval-granted-for-giga-berlin/&quot;
  Invalid value at 'data.values[11]' (type.googleapis.com/google.protobuf.ListValue), &quot;Carrie Hampel&quot;&quot;. Details: &quot;[{'@type': 'type.googleapis.com/google.rpc.BadRequest', 'fieldViolations': [{'field': 'data.values[0]', 'description': 'Invalid value at \'data.values[0]\' (type.googleapis.com/google.protobuf.ListValue), &quot;electrive&quot;'}, {'field': 'data.values[1]', 'description': 'Invalid value at \'data.values[1]\' (type.googleapis.com/google.protobuf.ListValue), &quot;Automobile&quot;'}, {'field': 'data.values[2]', 'description': 'Invalid value at \'data.values[2]\' (type.googleapis.com/google.protobuf.ListValue), &quot;Environmental approval granted for Giga Berlin&quot;'}, {'field': 'data.values[3]', 'description': 'Invalid value at \'data.values[3]\' (type.googleapis.com/google.protobuf.ListValue), &quot;2022&quot;'}, {'field': 'data.values[4]', 'description': 'Invalid value at \'data.values[4]\' (type.googleapis.com/google.protobuf.ListValue), &quot;03&quot;'}, {'field': 'data.values[5]', 'description': 'Invalid value at \'data.values[5]\' (type.googleapis.com/google.protobuf.ListValue), &quot;06&quot;'}, {'field': 'data.values[6]', 'description': 'Invalid value at \'data.values[6]\' (type.googleapis.com/google.protobuf.ListValue), &quot;2022/03/06&quot;'}, {'field': 'data.values[10]', 'description': 'Invalid value at \'data.values[10]\' (type.googleapis.com/google.protobuf.ListValue), &quot;https://www.electrive.com/2022/03/06/environmental-approval-granted-for-giga-berlin/&quot;'}, {'field': 'data.values[11]', 'description': 'Invalid value at \'data.values[11]\' (type.googleapis.com/google.protobuf.ListValue), &quot;Carrie Hampel&quot;'}]}]&quot;&gt;
  [Finished in 3.4s with exit code 1]
  </code></pre>