Closed leewenjie closed 6 years ago
Ownself question, ownself answer.
It works now, use this instead.
`` for post in fb.search(me[0], type=NEWS, count=100): print repr(post.id) print repr(post.text) print repr(post.url)
if post.comments > 0:
print '%i comments' % post.comments
print [(r.text, r.author) for r in fb.search(post.id, type=COMMENTS)]
if post.likes > 0:
print '%i likes' % post.likes
print [r.author for r in fb.search(post.id, type=LIKES)]
``
Hi,
This error is regarding the facebook scaping feature. When I run the following example codes...
`` from pattern.web import Facebook, NEWS, COMMENTS, LIKES
fb = Facebook(license='own_generated_code_from_developers.facebook.com/tools/explorer/') me = fb.profile(id=None) # user info dict
for post in fb.search(me['id'], type=NEWS, count=100): print repr(post.id) print repr(post.text) print repr(post.url)
``
I get the following error...
for post in fb.search(me['id'], type=NEWS, count=100): TypeError: tuple indices must be integers, not str
Can anyone help on this?