2 回答

TA貢獻1809條經驗 獲得超8個贊
請注意,如果您&indexpageids=true在API請求URL中使用參數,則結果將包含“ pageids”數組,如下所示:
str = ` {
"query": {
"pageids": [
"66984"
],
"pages": {
"66984": {
"pageid": 66984,
"ns": 0,
"title": "Main Page",
"touched": "2012-11-23T06:44:22Z",
"lastrevid": 1347044,
"counter": "",
"length": 28,
"redirect": "",
"starttimestamp": "2012-12-15T05:21:21Z",
"edittoken": "bd7d4a61cc4ce6489e68c21259e6e416+\\"
}
}
}
}`
因此您可以使用pageids[0]來訪問不斷變化的數字,這可能會使事情變得更容易。
- 2 回答
- 0 關注
- 220 瀏覽
添加回答
舉報