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

IndexError thrown when trying to parse tagged users #32

Closed
Recursing opened this issue Mar 22, 2018 · 4 comments
Closed

IndexError thrown when trying to parse tagged users #32

Recursing opened this issue Mar 22, 2018 · 4 comments

Comments

@Recursing
Copy link

from twitter_scraper import get_tweets
next(get_tweets("socgaudenti"))

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../python3.6/site-packages/twitter_scraper.py", line 78, in get_tweets
    yield from gen_tweets(pages)
  File ".../python3.6/site-packages/twitter_scraper.py", line 35, in gen_tweets
    text = tweet.find('.tweet-text')[0].full_text
IndexError: list index out of range

It seems to be triggered by the "Tagged users" at the bottom of https://twitter.com/socgaudenti/status/975725303808086016 (I'm new to twitter)

A simple fix could be discarding those elements

@Recursing Recursing changed the title IndexError thrown when trying to parse non tweets IndexError thrown when trying to parse tagged users Mar 22, 2018
@ghost
Copy link

ghost commented Sep 19, 2018

@Recursing I'm also getting the same error. Were you able to fix it?
twitter_scraper error

@ghost
Copy link

ghost commented Sep 19, 2018

@Recursing please elaborate when you say "A simple fix could be discarding those elements". Thanks!

@ghost
Copy link

ghost commented Sep 19, 2018

Putting a try and except IndexError makes it readable

@ParthS007
Copy link

Closing due to inactivity 👍

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

2 participants