question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fetching posts by post search?

See original GitHub issue

Hi 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:open
  • Created 2 years ago
  • Comments:24 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
neon-ninjacommented, Dec 19, 2021

Merged 👍

1reaction
Ethan353commented, Dec 6, 2021

I requested with new branch named search_word

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found