Open rezemika opened 3 years ago
In order to get the full text for these longer posts, the scraper needs to "click" on the post, which in some cases requires a login, even for public posts. Are you passing cookies or credentials?
Oh, I didn't knew that, I'm sorry!
So I think it's okay, but strangely I get a LoginError
when I try with credentials, so I can't confirm it.
I think I can close the issue now...
Try pass cookies instead of credentials
i have the same issue. im passing cookies. i didn't get a login error. im trying to access content From Msonepage facebook page.
but the result is
This is working fine for me, the code
for post in get_posts("Msonepage", pages=4):
print(post["post_id"], len(post["text"]), post["time"])
outputs
4291168727602719 1621 2021-06-19 18:08:23
4289245764461682 2076 2021-06-19 00:56:06
4288623407857251 1287 2021-06-18 19:33:07
4286718564714402 1445 2021-06-18 01:57:01
4286573484728910 1612 2021-06-18 00:57:27
4286358808083711 1089 2021-06-17 23:19:30
4286150838104508 1406 2021-06-17 21:31:05
4285963538123238 1704 2021-06-17 19:53:26
4285766488142943 1702 2021-06-17 17:50:41
4282950005091258 1083 2021-06-16 16:51:45
4281111508608441 1260 2021-06-16 00:47:32
4280365558683036 1184 2021-06-15 17:36:44
4278535115532747 1324 2021-06-15 00:54:21
4277809098938682 947 2021-06-14 18:03:47
Do you get any locale warnings when you run the scraper? Please try enable logging (if you're using the CLI, with the -v, --verbose
argument) and post the logs
it is weird.. now works without any problems. but now i get only one response. before i was getting 4 posts. how to increase the number of posts?
facebook-scraper --verbose --filename mu_page_posts.csv --pages 20 Msonepage -c cookies.txt
warnings.warn(f"Locale detected as {locale} - for best results, set to en_US")
[4291918264194432] Exception while running extract_text: AttributeError("'NoneType' object has no attribute 'find'")
[4291918264194432] Extract method extract_link didn't return anything
[4291918264194432] Extract method extract_video didn't return anything
[4291918264194432] Extract method extract_video_thumbnail didn't return anything
[4291918264194432] Extract method extract_video_id didn't return anything
[4291918264194432] Extract method extract_video_meta didn't return anything
[4291918264194432] Extract method extract_factcheck didn't return anything
[4291918264194432] Extract method extract_share_information didn't return anything
[4291918264194432] Extract method extract_listing didn't return anything
[4291742574212001] Extract method extract_video didn't return anything
[4291742574212001] Extract method extract_video_thumbnail didn't return anything
[4291742574212001] Extract method extract_video_id didn't return anything
[4291742574212001] Extract method extract_video_meta didn't return anything
[4291742574212001] Extract method extract_factcheck didn't return anything
[4291742574212001] Extract method extract_share_information didn't return anything
[4291742574212001] Extract method extract_listing didn't return anything
[4291474120905513] Extract method extract_video didn't return anything
[4291474120905513] Extract method extract_video_thumbnail didn't return anything
[4291474120905513] Extract method extract_video_id didn't return anything
[4291474120905513] Extract method extract_video_meta didn't return anything
[4291474120905513] Extract method extract_factcheck didn't return anything
[4291474120905513] Extract method extract_share_information didn't return anything
[4291474120905513] Extract method extract_listing didn't return anything ```
verbose is here.
some times i get this error.
Exception: ReadTimeout(ReadTimeoutError("HTTPSConnectionPool(host='m.facebook.com', port=443): Read timed out. (read timeout=5)"))
also i set en_US in cookie settings from firefox plugin. still showing locale warning
This commit (https://github.com/kevinzg/facebook-scraper/commit/320d81189e4c6c5023397c93bd02543ea36f1d05) should make it possible to pass a timeout via CLI. The language would be set on your account from https://www.facebook.com/settings?tab=language§ion=account&view, the cookie with the name locale is ignored by Facebook now. You would need to re-export your cookies after changing language. Do you have a cookie called noscript? This might be causing the problem.
Hi! I try to scrape posts from many pages for a research project, and some post texts are not scraped, especially the last ones in a page.
For example, here is the CSV line I get for this post: https://www.facebook.com/action.street.medics.rennes/posts/101587394720324
As another example, here is the result for this post: https://facebook.com/actionmedic44/posts/1339111329559911
I'm trying to understand how the parsing is handled (I haven't done Python for a while), don't hesitate if I can help you!