`get_posts_by_search` has no return
See original GitHub issueHello, guys! I’m having trouble using get_posts_by_search
to get posts. Here’s my code:
import facebook_scraper as fb
fb.set_cookies("cookies.txt")
keywords = "nintendo"
for post in fb.get_posts_by_search(keywords, pages=10, options={"comments": True, "reactors": True, "allow_extra_requests": True}):
print(post['text'])
It returns no errors but also no posts. Only a few times it can work as expected but it really confuses me. Do you know how to fix it? Very appreciated for your reply!
Issue Analytics
- State:
- Created a year ago
- Comments:8
Top Results From Across the Web
Forcing WP_Query To Return No Results - Cameron Jones
Forcing WP_Query To Return No Results ... The WP_Query object is the primary way of retrieving a post, or a number of posts...
Read more >Empty search input does not return all posts
I am working on WordPress custom post type search functionality. When I have searched with an empty value, it does not return all...
Read more >Is it possible to have get_posts() or WP_Query not return the ...
The only way I'm aware is to rewrite the SQL query with a filter from a plugin (or functions.php in your theme).
Read more >get_posts() | Function - WordPress Developer Resources
Retrieves an array of the latest posts, or posts matching the given criteria.
Read more >relevanssi_do_query() | Relevanssi
No return value, the results are placed in the posts attribute of the WP_Query object. Usage. This function can be used to run...
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
I came across same situation. I modifed source code below, then solved. I suppose that Facebook’s site codes changed. Hope it helps.
@yangsu10yen It works! Sorry for replying too late. But here’s another problem.
get_posts_by_search
ends after getting 9 posts. Do you know why it happens?