facebook-scraper: 500 Server Error: Internal Server Error for url

v0.2.38

code:

import time

from facebook_scraper import get_posts

COOKIES_PATH = r'...\cookies.json'
PAGE_NAME = 'EnvironmentCentreNT'

start = time.time()
posts = []

try:
    for post in get_posts(PAGE_NAME, cookies=COOKIES_PATH, pages=200, timeout=60,
                          options={"allow_extra_requests": False, "posts_per_page": 4}):
        posts.append(post)

        print(len(posts), post['time'], post['text'][:35].replace('\n', ' '))
except Exception as e:
    print(f'{e}')
    print(f"{len(posts)} posts retrieved in {round(time.time() - start)}s. Oldest post: {posts[-1].get('time')}")

Output:

1 2021-05-28 07:37:10.757897 The Northern Territory’s spectacula
2 2021-05-27 12:23:00 MEDIA RELEASE Conservationists, tou
.
.
.
160 2021-02-16 06:37:00 New species of stygofauna could sin
161 2021-02-16 03:04:00 The Environment Centre is standing 
500 Server Error: Internal Server Error for url: https://m.facebook.com/page_content_list_view/more/?page_id=137377391864&start_cursor=%7B%22timeline_cursor%22%3A%22AQHREcuuhRramTIzIbDKw-OdrKBvvCXrUsH7tUg0gzGFnSEW1WPoCCEzn-VTfW3soVYnK6oGpR-bj4Pwmvfy0Ai7G6TFAquDcSXW_jM8EV_HYbmSgeMKle5EbmmwqfknNOwd%22%2C%22timeline_section_cursor%22%3Anull%2C%22has_next_page%22%3Atrue%7D&num_to_fetch=4&surface_type=posts_tab
161 posts retrieved in 83s. Oldest post: 2021-02-16 03:04:00

Every time same output at exactly same location

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 30

Most upvoted comments

This doesn’t make sense anymore. I’m giving up. Hope it may get fixed by its own. Thank you for your response.

Sure, published as 0.2.40