Export Comments Từ Facebook Post

Exporting a Facebook comment thread directly into Excel or Google Sheets isn’t a straightforward process, as Facebook does not provide a built-in feature for this. However, you can achieve it through a few steps:

Method 1: Manual Copy and Paste

  1. Open the Comment Thread: Navigate to the Facebook post and open the comment thread you want to export.
  2. Select Comments: Click and drag your mouse to highlight the comments you wish to copy. Make sure to include any relevant details, such as the commenter’s name and the date.
  3. Copy the Comments: Right-click and select “Copy” or use Ctrl + C (Windows) or Cmd + C (Mac).
  4. Paste into Excel/Google Sheets: Open Excel or Google Sheets, select a cell, and right-click to choose “Paste” or use Ctrl + V (Windows) or Cmd + V (Mac).

Method 2: Using a Web Scraper

If you need to export a large number of comments or do this frequently, consider using a web scraping tool. Here’s a basic outline:

  1. Choose a Web Scraping Tool: Tools like ParseHub, Octoparse, or browser extensions like Web Scraper can help.
  2. Set Up the Scraper: Configure the scraper to target the Facebook post URL and extract the comment data (commenter name, comment text, timestamp).
  3. Export Data: Most web scrapers allow you to export the collected data in CSV format, which you can then open in Excel or import into Google Sheets.

Method 3: Facebook Graph API

If you are familiar with programming, you can use the Facebook Graph API:

  1. Create a Facebook App: Go to the Facebook Developer portal and create an app.
  2. Access the Graph API: Use the Graph API Explorer to fetch comments from a specific post.
  3. Export Data: You can write a script (in Python, for example) to retrieve the comments and save them in a CSV format.

Example Python Script Using Requests

Here’s a very simplified example of how you might use Python to get comments from a post:

  1. import requests 
  2. import csv 
  3.  
  4. # Replace with your access token and post ID 
  5. access_token = ‘YOUR_ACCESS_TOKEN’ 
  6. post_id = ‘POST_ID’ 
  7.  
  8. url = f’https://graph.facebook.com/{post_id}/comments?access_token={access_token}’ 
  9. response = requests.get(url) 
  10. comments = response.json().get(‘data’, []) 
  11.  
  12. # Write comments to a CSV file 
  13. with open(‘comments.csv’, ‘w’, newline=”, encoding=’utf-8′) as csvfile: 
  14. writer = csv.writer(csvfile) 
  15. writer.writerow([‘Commenter’, ‘Comment’, ‘Created Time’]) 
  16. for comment in comments: 
  17. writer.writerow([comment[‘from’][‘name’], comment[‘message’], comment[‘created_time’]]) 

Notes

  • Privacy: Be mindful of Facebook’s data privacy policies and ensure you have permission to scrape or use the data.
  • Rate Limits: If using the API, be aware of rate limits and other restrictions.

These methods should help you export Facebook comment threads into Excel or Google Sheets effectively!

Source: https://www.quora.com/Is-there-an-easy-way-to-export-a-Facebook-comment-thread-into-an-Excel-or-Google-sheet