KeyError: 'isbn'

来源:3-7 从API获取数据

sss89

2018-12-26

File “C:\Users\sun.virtualenvs\fisher-n59Ioj7P\lib\site-packages\flask\app.py”, line 1741, in handle_exception
reraise(exc_type, exc_value, tb)
File “C:\Users\sun.virtualenvs\fisher-n59Ioj7P\lib\site-packages\flask_compat.py”, line 35, in reraise
raise value
File “C:\Users\sun.virtualenvs\fisher-n59Ioj7P\lib\site-packages\flask\app.py”, line 2292, in wsgi_app
response = self.full_dispatch_request()
File “C:\Users\sun.virtualenvs\fisher-n59Ioj7P\lib\site-packages\flask\app.py”, line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File “C:\Users\sun.virtualenvs\fisher-n59Ioj7P\lib\site-packages\flask\app.py”, line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File “C:\Users\sun.virtualenvs\fisher-n59Ioj7P\lib\site-packages\flask_compat.py”, line 35, in reraise
raise value
File “C:\Users\sun.virtualenvs\fisher-n59Ioj7P\lib\site-packages\flask\app.py”, line 1813, in full_dispatch_request
rv = self.dispatch_request()
File “C:\Users\sun.virtualenvs\fisher-n59Ioj7P\lib\site-packages\flask\app.py”, line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File “C:\Users\sun\Desktop\fisher\fisher.py”, line 23, in search
result = YuShuBook.search_by_isbn(q)
File “C:\Users\sun\Desktop\fisher\yushu_book.py”, line 14, in search_by_isbn
url = cls.isbn_url.format(isbn)
KeyError: 'isbn’
报错KeyError: ‘isbn’ 但我看代码和视频里面的一样啊 老师 是啥情况

写回答

1回答

7七月

2019-01-01

调试看一下 还是代码写错了。没有找到isbn这个key。

0
0

Python Flask高级编程之从0到1开发《鱼书》精品项目

7月老师深入浅出剖析Flask核心机制,和你一起探讨Python高级编程

2735 学习 · 1267 问题

查看课程