facebook-scraper | Scrape Facebook public pages without an API key | Scraper library
kandi X-RAY | facebook-scraper Summary
kandi X-RAY | facebook-scraper Summary
Scrape Facebook public pages without an API key. Inspired by twitter-scraper.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Parse arguments
- Set cookies
- Get a single profile
- Enable logging
- Extracts the photos link
- Extract the text of the article
- Get posts by word
- Login to the scraper session
- Extracts share information from the post
- Extract the time of the post
- Extract post url
- Remove query parameters from a URL
- Fetch full post
- Extract likes from post
- Get all reactors
- Get search pages by word
- Return an iterable of friends
- Extract comments
- Get a list of Shop objects
- Get information about a group
- Get information about a given account
- Get groups by search
- Iterate over the pages of a hashtag
- Iterate over group pages
- Extract the video thumbnail
- Return the live data object
facebook-scraper Key Features
facebook-scraper Examples and Code Snippets
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import fb_scraper.prodcons
APP_ID = ''
APP_ID_SECRET = ''
ACCESS_TOKEN = ''
def main():
mgr = fb_scraper.prodcons.Manager(
access_token=ACCESS_TOKEN,
api_key=APP_ID,
api_sec
open("facebook.csv", "w", newline="")
import csv
from facebook_scraper import get_posts
for post in get_posts('bibliotecaunespbauru', pages=10):
data = [post['post_id'], post['text'], post['image']]
with op
try:
for post in get_posts('ThaiPBSFan', pages=50):
print(post['text'][:100])
except AttributeError:
print("No more posts to get")
if 'paging' in statuses.keys() and 'next' in statuses['paging'] and statuses['paging']['next']:
Community Discussions
Trending Discussions on facebook-scraper
QUESTION
Now i'm doing some project use laravel framework. do i able to run Symfony Process function inside a queue jobs?
...ANSWER
Answered 2020-Nov-25 at 14:12I think the problem is the paths. Replace the --filename
option value with the absolute path (from /):
QUESTION
now im doing laravel project and i want to run a command exec()
on queue jobs. the Question is, do i really can run the command exec()
on queue jobs?
this what i've done, i create a jobs file call app/Jobs/GetData.php
and create a simple code.
ANSWER
Answered 2020-Nov-23 at 15:42To solve the issue of non working command you have to either create env variables which points to Facebook-scraper or use the full path(absolute not relative) of facebook scraper package.
So the process construction should be something like
QUESTION
I am writing a code (yes, I am new with this) to extract information from a page on facebook. I am using facebook-scraper to get the info. I need to create a CSV file to store this information, but I always come out empty.
Original code
...ANSWER
Answered 2020-Nov-08 at 16:43You have two issues with your code.
The first problem is with how you create data
Wrong
[print(post['post_id']), print(post['text']), print(post['image'])]
Why
In this line you are printing as you get the values, the return
value of a print is None
and hence None
is stored in the list.
Old Output of data
at each iteration: [None, None, None]
Correction:
[post['post_id'], post['text'], post['image']]
.
Output of new data
: ['2092819824183367', 'Biblioteca da Unesp em Bauru ganha nova identidade visual ❤️\n\nhttps://youtu.be/dTCGp1eGmtM\n\nYOUTUBE.COM\nBiblioteca da Unesp em Bauru ganha nova identidade visual', None]
(PS : idk what that translates to)
Second problem being the way you write to a file.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install facebook-scraper
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page