Skip to content

Pagination url from Facebook #721

Answered by neon-ninja
liulilli asked this question in Q&A
Discussion options

You must be logged in to vote

Here's how you can retrieve posts quickly, logging timestamps and pagination URLs:

def handle_pagination_url(url):
    print(url)

for post in get_posts("cnninternational", pages=None, options={'allow_extra_requests': False, 'posts_per_page': 200}, request_url_callback=handle_pagination_url):
    print(post["time"])

Sample output:

2022-03-03 10:30:09
https://m.facebook.com/page_content_list_view/more/?page_id=18793419640&start_cursor={"timeline_cursor":"AQHRETPViw_PpYB8dvuQv_nxWo4tDuVr9kDnxwrV6GsELF02wsIOTobJTeozaNOOK1iPD6iEAxbPJRs5sIT9QYh3YPwRpaOnv6oLSBa7u6P4zkX9EQYxXLZwZcLg6B4NuP4Z","timeline_section_cursor":null,"has_next_page":true}&num_to_fetch=200&surface_type=posts_tab
2022-03-03 10:

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@liulilli
Comment options

@liulilli
Comment options

@neon-ninja
Comment options

@liulilli
Comment options

Answer selected by neon-ninja
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants