sriniskanda / extracts-comments-and-posts-from-facebook Goto Github PK
View Code? Open in Web Editor NEWThis python code extracts Facebook comments and posts using graph API and saves it in csv file.
This python code extracts Facebook comments and posts using graph API and saves it in csv file.
ile "C:\Users\Asus\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 1317, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "C:\Users\Asus\AppData\Local\Programs\Python\Python37-32\lib\http\client.py", line 1229, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\Asus\AppData\Local\Programs\Python\Python37-32\lib\http\client.py", line 1275, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Users\Asus\AppData\Local\Programs\Python\Python37-32\lib\http\client.py", line 1224, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\Asus\AppData\Local\Programs\Python\Python37-32\lib\http\client.py", line 1016, in _send_output
self.send(msg)
File "C:\Users\Asus\AppData\Local\Programs\Python\Python37-32\lib\http\client.py", line 956, in send
self.connect()
File "C:\Users\Asus\AppData\Local\Programs\Python\Python37-32\lib\http\client.py", line 928, in connect
(self.host,self.port), self.timeout, self.source_address)
File "C:\Users\Asus\AppData\Local\Programs\Python\Python37-32\lib\socket.py", line 707, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "C:\Users\Asus\AppData\Local\Programs\Python\Python37-32\lib\socket.py", line 748, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/Asus/PycharmProjects/myfirst/facbook_screp.py", line 124, in
main()
File "C:/Users/Asus/PycharmProjects/myfirst/facbook_screp.py", line 107, in main
post_data = scrap_post_by_date(post_url, last_crawl, post_data)
File "C:/Users/Asus/PycharmProjects/myfirst/facbook_screp.py", line 32, in scrap_post_by_date
page_posts = take_data_to_json(graph_url)
File "C:/Users/Asus/PycharmProjects/myfirst/facbook_screp.py", line 24, in take_data_to_json
web_response = urlopen(graph_url)
File "C:\Users\Asus\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "C:\Users\Asus\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 525, in open
response = self._open(req, data)
File "C:\Users\Asus\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 543, in _open
'_open', req)
File "C:\Users\Asus\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 503, in _call_chain
result = func(*args)
File "C:\Users\Asus\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 1345, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "C:\Users\Asus\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 1319, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 11001] getaddrinfo failed>
I want to get all comments from my account. So I have called the python file using this command
python3 Crawler.py protik.nag.14 100 ************************ ****************
But this shows the following error.
Traceback (most recent call last):
File "Crawler.py", line 124, in
main()
File "Crawler.py", line 107, in main
post_data = scrap_post_by_date(post_url, last_crawl, post_data)
File "Crawler.py", line 32, in scrap_post_by_date
page_posts = take_data_to_json(graph_url)
File "Crawler.py", line 23, in take_data_to_json
web_response = urlopen(graph_url)
File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.6/urllib/request.py", line 532, in open
response = meth(req, response)
File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.6/urllib/request.py", line 570, in error
return self._call_chain(*args)
File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/lib/python3.6/urllib/request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
What can I do now?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.