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: 'items_html' #164

Open
vbandaru opened this issue Aug 7, 2020 · 3 comments
Open

KeyError: 'items_html' #164

vbandaru opened this issue Aug 7, 2020 · 3 comments

Comments

@vbandaru
Copy link

vbandaru commented Aug 7, 2020

for tweet in get_tweets("$AMD", pages=1):
  print(tweet['text'])

retruns error

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/twitter_scraper/modules/tweets.py in gen_tweets(pages)
     36                 html = HTML(
---> 37                     html=r.json()["items_html"], url="bunk", default_encoding="utf-8"
     38                 )

KeyError: 'items_html'

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
2 frames
/usr/local/lib/python3.6/dist-packages/twitter_scraper/modules/tweets.py in gen_tweets(pages)
     39             except KeyError:
     40                 raise ValueError(
---> 41                     f'Oops! Either "{query}" does not exist or is private.'
     42                 )
     43             except ParserError:

ValueError: Oops! Either "$AMD" does not exist or is private.
@koaly
Copy link

koaly commented Nov 20, 2020

having the same error.

@tuchang
Copy link

tuchang commented Dec 11, 2020

having the same error, but you used $ I used #

@antick
Copy link

antick commented Dec 19, 2020

I am facing the same issue.

It uses the following URL internally to fetch tweets:

https://twitter.com/i/search/timeline?f=tweets&vertical=default&q=%7Bquery%7D&src=tyah&reset_error_state=false&

And the above URL does not exist anymore.

Repository owner deleted a comment from Altimis Dec 19, 2020
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

4 participants