檢索提取所以我得到一個JSON響應,看起來像這樣: {
"batchcomplete": "",
"query": {
"pages": {
"97646": {
"pageid": 97646,
"ns": 0,
"title": "Die Hard",
"extract": "Die Hard is a 1988
我使用python庫維基百科來解析數據。當它到達代碼的第二部分時,我會收到頁面錯誤。 Page Errors import wikipedia
print ("1: Searching Wikipedia for 'List of Lexus vehicles'")
try:
print (wikipedia.page('List of Lexus'))
print (
我正在使用Wikipedia API封裝解析來自頁面的數據。我的lexus_count函數有問題。這是數函數的輸出: The Wikipedia page for 'List of Lexus_(vehicles)' has <function lexus_count at 0x0000020B039A8268> occurrences of the word 'Lexus'"
下面是代碼: