title: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) error occurs sometimes using googletrans and Pandas in Python
body: <p>I have the following code that sometimes works and sometimes doesn't.. I haven't figured out any patterns as to why the code wouldn't work, but I have confirmed the following:</p>
  
  <ul>
  <li>The background data has ~1000 rows</li>
  <li>All values in df['Comments'] are NOT null</li>
  </ul>
  
  <p>I believe it has something to do with tapping into the Google API, but I do not know. Does anyone know what the issue is here? If not, are there alternatives out there for language translation in python?</p>
  
  <p>Error:</p>
  
  <pre><code>    raise JSONDecodeError("Expecting value", s, err.value) from None
  json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>from googletrans import Translator
  import pandas as pd
  import xlsxwriter
  import xlrd
  import copy
  
  ##################TRANSLATION
  
  translator = Translator()
  file = r"xxxx"
  #dt2 = translator.detect(text2)
  
  df = pd.read_excel(file, sheet_name = 'Sheet1', converters={'Comments':str}).fillna(0)
  
  df = df[df['Comments'] != 0]
  
  
  translatedList = []
  for index, row in df.iterrows():
      # REINITIALIZE THE API
      translator = Translator()
      newrow = copy.deepcopy(row)
      try:
          # translate the 'text' column
          translated = translator.translate(row['Comments'], dest='en')
          newrow['translated'] = translated.text
      except Exception as e:
          print(str(e))
          continue
      translatedList.append(translated.text)
  df = df.assign(translatedv4 = translatedList) 
  
  #translator = Translator()
  
  #df['English'] = df['Comments'].apply(translator.translate,dest='en').apply(getattr, args=('text',)) #MAY RUN INTO LIMITS
  
  
  #df['Translated_Python'] = df['Comments'].map(lambda x: translator.translate(x, src="de", dest="en").text)
  #print(df['Translated_Python'])
  
  #s = fuzz.ratio("Wow year what a ","This is a test")
  #print(s)
  
  end = r"xxxx"
  
  writer = pd.ExcelWriter(end, engine='xlsxwriter')
  df.to_excel(writer, sheet_name='Data')
  translatedList.to_excel(writer, sheet_name='List')
  writer.save()
  </code></pre>
  
  <p>Traceback:
  <a href="https://i.stack.imgur.com/mww4t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mww4t.png" alt="enter image description here"></a></p>
  
  <p>Option 2: 
  <a href="https://i.stack.imgur.com/22415.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/22415.png" alt="enter image description here"></a></p>