Fetching posts by post search?
See original GitHub issueHi guys, I like the work you have done with this so far. I’m not sure if this is in the pipeline yet, but I would like to enter a search term into Facebook and get back a certain number of posts per page including comments.
For example:
from facebook_scraper import get_posts_by_search, set_cookies
set_cookies("cookies.txt")
search_query = "Mark Zuckerberg"
# generating url search posts request ('https://www.facebook.com/search/posts/?q=Mark%20Zuckerberg')
posts = get_posts_by_search(search_query, pages=3, options={"comments": True, "posts_per_page": 5})
for p in posts:
pass # get a list of posts as a return
I’m happy to help to work this one out as well.
Issue Analytics
- State:
- Created 2 years ago
- Comments:24 (6 by maintainers)
Top Results From Across the Web
get_posts() | Function - WordPress Developer Resources
Retrieves an array of the latest posts, or posts matching the given criteria. ... An array of post IDs to retrieve, sticky posts...
Read more >Here's How to Retrieve Any Post You Want With WP_Query
WP_Query is your friend, it allows you to pull posts from the database according to your criteria. Here's how to use it.
Read more >How to programmatically fetch posts matching a search query ...
Passing a query variable of "s" to WP_Query with a search term will filter post results by search term: $query_args = array( 's'...
Read more >getting posts by tags - wp query - WordPress Stack Exchange
Do you want to apply LIKE search on tags? – Gufran Hasan. Nov 16, 2018 at 14:23. Add a comment ...
Read more >WordPress get_posts: How to Use This PHP Function to Build ...
Need to create lists of posts, pages, or custom post types? ... The same way, we can build queries fetching posts by category,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Merged 👍
I requested with new branch named search_word