You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting the following error when trying to call the build_payload method:
Perhaps google has changed the response?
pytrends.build_payload(keyword, cat=0, timeframe=time_frames[index], geo=geo_location, gprop='') File "/usr/local/lib/python3.12/site-packages/pytrends/request.py", line 169, in build_payload self._tokens() File "/usr/local/lib/python3.12/site-packages/pytrends/request.py", line 175, in _tokens widget_dict = self._get_data( ^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pytrends/request.py", line 134, in _get_data 'application/javascript' in response.headers['Content-Type'] or \ ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/requests/structures.py", line 52, in __getitem__ return self._store[key.lower()][1] ~~~~~~~~~~~^^^^^^^^^^^^^ KeyError: 'content-type'
The text was updated successfully, but these errors were encountered:
uzairamer
changed the title
KeyError: 'content-type'` when calling build_payload()
KeyError: 'content-type' when calling build_payload()
Feb 21, 2024
Getting the following error when trying to call the build_payload method:
Perhaps google has changed the response?
pytrends.build_payload(keyword, cat=0, timeframe=time_frames[index], geo=geo_location, gprop='') File "/usr/local/lib/python3.12/site-packages/pytrends/request.py", line 169, in build_payload self._tokens() File "/usr/local/lib/python3.12/site-packages/pytrends/request.py", line 175, in _tokens widget_dict = self._get_data( ^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pytrends/request.py", line 134, in _get_data 'application/javascript' in response.headers['Content-Type'] or \ ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/requests/structures.py", line 52, in __getitem__ return self._store[key.lower()][1] ~~~~~~~~~~~^^^^^^^^^^^^^ KeyError: 'content-type'
The text was updated successfully, but these errors were encountered: