使用page.info的页面信息

时间:2012-09-19 17:47:47

标签: facebook python-2.7 facebook-page pyfacebook

我正在尝试获取页面信息。自己。我已经在python中编写了代码

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。请修改我

1 个答案:

答案 0 :(得分:0)

Traceback如下......

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