tweepy
v4.10.1
  • 설치하기
  • Tweepy 시작하기
  • 인증
  • Logging
  • 스트리밍

Twitter API v1.1 Reference

  • API
  • Stream
  • AsyncStream
  • 예외
  • Models
  • Pagination
  • 확장 트윗

Twitter API v2 Reference

  • Client
  • Response
  • StreamingClient
  • StreamResponse
  • StreamRule
  • AsyncClient
  • AsyncStreamingClient
  • 예외
  • Expansions and Fields
  • Models
  • Pagination

Meta

  • 체인지로그
  • 개발
  • 예시
  • 자주 묻는 질문(FAQ)
tweepy
  • »
  • Pagination
  • Edit on GitHub

Pagination

class tweepy.Paginator(method, *args, **kwargs)

Paginator can be used to paginate for any Client methods that support pagination

버전 4.0에 추가.

매개변수
  • method – Client method to paginate for

  • args – Positional arguments to pass to method

  • kwargs – Keyword arguments to pass to method

flatten(limit=inf)

Flatten paginated data

매개변수

limit – Maximum number of results to yield

Example

import tweepy

client = tweepy.Client("Bearer Token here")

for response in tweepy.Paginator(client.get_users_followers, 2244994945,
                                    max_results=1000, limit=5):
    print(response.meta)

for tweet in tweepy.Paginator(client.search_recent_tweets, "Tweepy",
                                max_results=100).flatten(limit=250):
    print(tweet.id)
Previous Next

© 저작권 2009-2022, Joshua Roesslein. Revision ad5e31be.

Built with Sphinx using a theme provided by Read the Docs.