如何獲得這兩個值utc_last_updated並給出下面的json名稱? 我使用了請求,獲取內容,然後使用BeautifulSoup使其像現在一樣。但是現在我只想提取我所展示的兩個值。如何使用,beautifulsoup和python從此json提取數據?
"data": [
{
"scm": "hg",
"has_wiki": false,
"last_updated": "2016-03-23T14:05:27.433",
"no_forks": false,
"created_on": "2016-03-18T22:55:52.705",
"owner": "user",
"email_mailinglist": "",
"is_mq": false,
"size": 420034,
"read_only": false,
"fork_of": null,
"mq_of": null,
"state": "available",
"utc_created_on": "2016-03-18 21:55:52+00:00",
"website": "",
"description": "",
"has_issues": false,
"is_fork": false,
"slug": "store",
"is_private": true,
"name": "store",
"language": "python",
"utc_last_updated": "2016-03-23 13:05:27+00:00",
"no_public_forks": true,
"creator": null,
"resource_uri": "/1.0/repositories/my_url"
},
{
"scm": "hg",
"has_wiki": false,
"last_updated": "2016-03-18T12:26:22.261",
"no_forks": false,
"created_on": "2016-03-18T12:19:08.262",
"owner": "user",
"email_mailinglist": "",
"is_mq": false,
"size": 173137,
"read_only": false,
"fork_of": null,
"mq_of": null,
"state": "available",
"utc_created_on": "2016-03-18 11:19:08+00:00",
"website": "",
"description": "",
"has_issues": false,
"is_fork": false,
"name": 'foo'
"is_private": true,,
"language": "python",
"utc_last_updated": "2016-03-18 11:26:22+00:00",
"no_public_forks": true,
"creator": null,
"resource_uri": "/1.0/repositories/my_rl"
},
} 我將不勝感激任何幫助。
這是您的充分反應?還是你從HTML文檔中獲得這個? – Gocht
它看起來不像你已正確格式化JSON。 – metersk
嗨,我正在以下:https://answers.atlassian.com/questions/18451025/how-to-hit-bitbucket-api-using-python-requests-module –