2012-09-19 73 views
0

我想獲取頁面信息。自己。我已經用Python寫的代碼使用page.info頁面信息

import facebook 
import sys 
import codecs 
api_key = 'key' 
secret_key = 'secret_key' 
client = facebook.Facebook(api_key, secret_key) 
client.auth.createToken() 
client.login() 
print '[*] Please login/give permission application to access you . Then press enter key to continue...' 
raw_input() 
client.auth.getSession() 
client.request_extended_permission("publish_stream", popup=False) 
raw_input() 
print "\n" 
info_pages = client.pages.getInfo([client.uid]) 
for info in info_pages: 
    for attr in info: 
     print '%s: %s' % (attr, info[attr]) 
info_pages =client.pages.getInfo('page_id','website','my uid') 
print info_pages 
print "\n\n" 
for info in info_pages: 
    print info 
    for attr in info: 
     print attr,":",str(info[attr]).replace("\n","\t") 
print "\n" 

,但我得到的錯誤作爲

facebook.FacebookError: Error 100: Param page_ids must be a valid page ID 

怎麼做我應該使用page_ids。請修改我

+0

什麼是pages.getInfo()? – Igy

+0

哪條語句會產生錯誤?你可以發佈回溯? –

回答

0

回溯如下...

Traceback (most recent call last): 
    File "page.py", line 19, in <module> 
    info_pages =client.pages.getInfo('page_id','website','my uid') 
    File "build/bdist.linux-i686/egg/facebook/__init__.py", line 877, in facebook_method 
    File "build/bdist.linux-i686/egg/facebook/__init__.py", line 900, in __call__ 
    File "build/bdist.linux-i686/egg/facebook/__init__.py", line 1558, in __call__ 
    File "build/bdist.linux-i686/egg/facebook/__init__.py", line 1491, in _parse_response 
    File "build/bdist.linux-i686/egg/facebook/__init__.py", line 1438, in _check_error 
facebook.FacebookError: Error 100: Param page_ids must be a valid page ID