Help regarding python facepy library
malhar vora
malhar.v.ntech at gmail.com
Mon Sep 16 03:10:55 EDT 2013
Hello all,
I am using python facepy library to fetch data from facebook. It was running fine. The problem now is I just changed my system and now getting error that says "certificate verify failed". Here my code and exception log both are given below.
The library that I have used is https://pypi.python.org/pypi/facepy
Code is given below.
#################################################################################
import facepy
from facepy import GraphAPI,exceptions
import json
graph = GraphAPI('my fb access token')
fb_dump = open('D:\\Malhar Data\\Projects\\Social Media Web Project\\TestGround\\temp\\Output\\output.txt', 'w')
try:
pages = graph.get('AhmedabadUniversity/posts', page=True)
all_pages = []
for page in pages:
all_pages = all_pages + page["data"]
except exceptions.OAuthError, error:
if error.code == 2:
print "Unexpected error occured"
elif error.code == 803:
print "Alias or Page does not exist"
for d in all_pages:
fb_dump.write("Message : " + d.get('message','None').encode("UTF-8", "ignore"))
fb_dump.close()
##########################################################################
Exception log is given below.
D:\Malhar Data\Projects\Social Media Web Project\TestGround\temp>python fbgrabbe
r.py
C:\Python26\lib\site-packages\facepy\graph_api.py:199: DeprecationWarning: BaseE
xception.message has been deprecated as of Python 2.6
raise HTTPError(exception.message)
Traceback (most recent call last):
File "fbgrabber.py", line 14, in <module>
for page in pages:
File "C:\Python26\Lib\site-packages\facepy\graph_api.py", line 212, in paginat
e
result, url = load(method, url, data)
File "C:\Python26\Lib\site-packages\facepy\graph_api.py", line 199, in load
raise HTTPError(exception.message)
facepy.exceptions.HTTPError: [Errno 1] _ssl.c:480: error:14090086:SSL routines:S
SL3_GET_SERVER_CERTIFICATE:certificate verify failed
============================================================================
I tried generating new token and run the script but got same error.
I didn't find any solution of this problem.
If anybody is able to figure out the problem, please help me.
Thank you,
Malhar Vora
More information about the Python-list
mailing list