【发布时间】:2010-12-22 20:41:52
【问题描述】:
我脑子坏了,但无法解决这个问题。
数字,名字是虚构的。但是思路是这样的
我阅读了类似“https://graph.facebook.com/123”之类的链接
这个结果到源代码:
{
"id": "123",
"name": "John Doe",
"first_name": "John",
"last_name": "Doe",
"link": "http://www.facebook.com/people/John-Doe/123",
"gender": "male",
"locale": "en_US"
}
我想提取id、name等所有信息
我试试这个,但失败了
link = 'https://graph.facebook.com/123'
result = browser.open(link)
text = result.read()
result.close()
id = re.search('"id": "(.*?)",', cont)
regex '"id": "(.*?)",' 似乎是正确的,但没有返回任何内容.. 为什么???
【问题讨论】: