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.

How to save particular result in csv when parsing from CLI ?

See original GitHub issue

I’m parsing fb pate from CLI like that:

facebook-scraper --filename nintendo_page_posts.csv --pages 5000 --cookies my_cookies.json nintendo

I parse many-many pages (try to parse all page posts once) and often get different errors (block, timeout, network error, etc). After that all hours of my work are lost. It there any option to save .csv file (maybe with different extension f.e. .csv.partial), even if error ocured ?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
neon-ninjacommented, Aug 15, 2021

https://github.com/kevinzg/facebook-scraper/commit/c61f3487612de418bf81b69e8b5cc981eecb4e0f should harden CLI post extraction a bit, catching exceptions and then writing out the CSV anyway. I would also recommend increasing the timeout with the timeout parameter if you’re running into timeout issues.

0reactions
neon-ninjacommented, Aug 23, 2021

That could be because the TemporarilyBanned exception is caught. It would still be logged in that case. Also note that the way the scraper detects temp bans, is by looking for the following page titles:

                "you can't use this feature at the moment",
                "you can't use this feature right now",
                "you’re temporarily blocked",

If your FB language is set to something other than English, then the title wouldn’t match those.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using the Cut Command to Parse a CSV File by Delimiters ...
Make quick work out of extracting useful data from any output that's semi-structured.Hit the subscribe button to receive more videos like ...
Read more >
Working with CSVs on the Command Line - Brian Connelly
To do this, just add the > character and the name of the file where you want the output to be stored to...
Read more >
Parse the output of my bash script and save as CSV
But I need to parse the verbose data from output, and eventually save some meaningful results as a .CSV file. Here is my...
Read more >
Using the Cut Command to Parse a CSV File ... - Nick Janetakis
Cut can make quick work out of extracting useful data from CSV files or output that has a pattern of characters or bytes....
Read more >
How to Parse a CSV File in Bash | Baeldung on Linux
In this tutorial, we'll learn how to parse values from Comma-Separated Values (CSV) files with various Bash built-in utilities.
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