-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Task index - list index out of range #5
Comments
Have you tried it without the proxy ? If it's working without the proxy, then you have to use premium proxies i.e. residential proxies. In your case its going to be something like this : from tweeterpy import TweeterPy
from tweeterpy import config
def main():
config.TIMEOUT = 5
config.PROXY = {"http":"proxyhere","https":"proxyhere"}
twitter = TweeterPy()
twitter.generate_session(auth_token="token-you-copied")
#twitter.save_session() #use this if u want to reuse the same session in future. Next time u can use twitter.load_session() instead of using .login() or .generate_session()
print(twitter.get_user_data("elonmusk"))
if __name__ == "__main__":
main()
Check documentation for more information. |
Hey, I guess it was some issue with the login method. I just fixed it. Hopefully, it should be working fine now. Try it !! |
Python version: 3.10
Code:
from tweeterpy import TweeterPy
from tweeterpy import config
def main():
config.TIMEOUT = 5
config.PROXY = {'http': 'xx.xxx.xx.xx', 'https': 'xx.xxx.xx.xx'}
twitter = TweeterPy()
print(twitter.get_user_id('elonmusk'))
print(twitter.get_user_info('elonmusk'))
# print(twitter.get_user_data('elonmusk'))
# print(twitter.get_user_tweets('elonmusk', total=200))
# print(twitter.get_user_media('elonmusk', total=100))
if name == "main":
main()
Error:
Traceback (most recent call last):
File "/home/machine/Desktop/twscrape/id.py", line 17, in
main()
File "/home/machine/Desktop/twscrape/id.py", line 9, in main
print(twitter.get_user_id('elonmusk'))
File "/usr/local/lib/python3.10/site-packages/tweeterpy/tweeterpy.py", line 110, in wrapper
self.login()
File "/usr/local/lib/python3.10/site-packages/tweeterpy/tweeterpy.py", line 189, in login
TaskHandler().login(username, password)
File "/usr/local/lib/python3.10/site-packages/tweeterpy/#_util.py", line 91, in login
task_id = [task_id for task_id in task_flow_mapper.keys() if task_id in tasks][0]
IndexError: list index out of range
Question:
I've just found a proxy and trying your example code above. The twitter username and password are applied correctly. What am I doing wrong and getting this error?
The text was updated successfully, but these errors were encountered: