Skip to content
This repository has been archived by the owner on Jul 14, 2020. It is now read-only.

Fixed codec bug #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion get_fb_posts_fb_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import datetime
import csv
import time
import codecs
try:
from urllib.request import urlopen, Request
except ImportError:
Expand All @@ -23,7 +24,8 @@ def request_until_succeed(url):
success = False
while success is False:
try:
response = urlopen(req)
reader = codecs.getreader("utf-8")
response = reader(urlopen(req))
if response.getcode() == 200:
success = True
except Exception as e:
Expand Down