Home>
I want to get the timeline using python,
At the end I get an error.
I'm wondering if this is the correct form because the access token I got is made up of only Xs. Is it properly acquired?
Also, since it is Traceback, is it the cause of the last status_list = api.home_timeline()?
python
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>import tweepy
>>>consumer_key = ""
>>>consumer_secret = ""
>>>access_token = "×××××××××××××××××××××"
>>>access_token_secret = "×××××××××××××××××××××××××"
>>>auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
>>>auth.set_access_token(access_token,access_token_secret)
>>>api = tweepy.API(auth)
>>>status_list = api.home_timeline()
Traceback (most recent call last):
File "<stdin>", line 1, in<module>
File "C:\Users\Shun\Documents\python\lib\site-packages\tweepy\binder.py", line 250, in _call
return method.execute()
File "C:\Users\Shun\Documents\python\lib\site-packages\tweepy\binder.py", line 233, in execute
raise TweepError(error_msg, resp, api_code=api_error_code)
tweepy.error.TweepError: [{'code': 89,'message':'Invalid or expired token.'}]
-
Answer # 1
-
Answer # 2
If you have forgotten your token,
Regenerate
You must either authenticate or verify your token.Click here for authentication with tweepy.
http://docs.tweepy.org/en/v3.8.0/auth_tutorial.html
This is an ordinary web authentication procedure.
halfwayraw_input
Is a Python 2 functioninput
Let's.
Related articles
- python - the py file cannot be executed in the task scheduler 0x2 error
- python 3x - best estimator: i get an error with no syntax, so please tell me what to do
- readcsv error in python
- python - i want to display an image with pysimplegui, but an error occurs
- i want to get the timeline of multiple users with twitter api
- python - error when scraping with selenium and firefox
- [python] graphviz output format error
- python - i get an error when connecting to a voice channel with discordpy
- [python] i don't know how to solve the error
- python - in raspberry pi, the error occurs only in the case of the automatic start program using systemd
- python - an error has occurred in yolo v3
- python - idle cannot resolve the "rootgeometry" error
- python - tuple error does not resolve
- python max () arg is an empty sequence and an error occurs and it cannot be processed well
- python 3x - error after changing to csv file
- python error code how to deal with
- python - categorical_crossentoropy error does not resolve
- python - error in image binarization using cv2adaptivethreshold function
- python - i get the error "no attribute'connect'" when connecting a signal to a slot
- i want to resolve a syntax error in a python while statement
Related questions
- python : List of dictionaries?
- javascript : How can I get the hidden site API
- How to write script via API in Python?
- How to translate into a normal format -a date from numbers. Python
- Hello, how can I bypass recaptcha v2 on a website via python, then login to the website and create cookies?
- You need to add a hyperlink and data from api for telegram bot in python
Make sure you read the details of the error.
Error: Code 89, using invalid or expired token! So change it!
about it. I'm not very familiar with this API, but why not revisit the token?
Although it is in English, the following sites may be helpful.
https://stackoverflow.com/questions/46062142/tweepy-tweeperror-code-89-invalid-or-expired-token