forked from kevinzg/facebook-scraper
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Truncated text post #69
Comments
@truephp can you post an example post ? and the script you are using to get it ? |
@moda20, I've created a page for test, try this code from facebook_scraper import get_posts
from facebook_scraper import exceptions
from facebook_scraper import enable_logging, write_posts_to_csv, get_profile
import simplejson as json
import os
import logging
enable_logging()
location = os.path.dirname(__file__)
try:
#posts = get_posts(61567187803636, pages=1, cookies=os.path.join(location, "cookies.txt"), options={"posts_per_page": 5})
posts = get_posts(61567187803636, start_url="https://mbasic.facebook.com/61567187803636?v=timeline", pages=1, cookies=os.path.join(location, "cookies.txt"), options={"posts_per_page": 10})
json_object = json.dumps(posts, iterable_as_array=True, default=str)
posts_file = os.path.join(location, 'poststext.json')
with open(posts_file, "w") as outfile:
outfile.write(json_object)
except exceptions.TemporarilyBanned:
print("Temporarily banned")
except exceptions.AccountDisabled:
print("Account Has Been Disabled")
except exceptions.InvalidCookies:
print("Cookies are not valid")
except Exception as e:
print(e.args) This script only parse the next text
but the original text is
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Posts with More link are parsed only with text before this link.
The text was updated successfully, but these errors were encountered: