Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'content-type' when calling build_payload() #616

Open
uzairamer opened this issue Feb 21, 2024 · 0 comments
Open

KeyError: 'content-type' when calling build_payload() #616

uzairamer opened this issue Feb 21, 2024 · 0 comments

Comments

@uzairamer
Copy link

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'

@uzairamer uzairamer changed the title KeyError: 'content-type'` when calling build_payload() KeyError: 'content-type' when calling build_payload() Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant