-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
32 lines (23 loc) · 919 Bytes
/
test.py
File metadata and controls
32 lines (23 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from melonbooks import Melonbooks, resolve_date
from models import SearchOptions
melonbooks = Melonbooks()
async def main():
# 调用 search 方法进行搜索
search_results = melonbooks.search('まちカドまぞく', options=SearchOptions(only_search_title=True, category=''))
for result in search_results:
print(result.title, result.url)
# 调用 detail 方法获取详细信息
detail_info = detail(search_results[0].url)
if detail_info:
print('Title:', detail_info.title)
print('Date:', detail_info.date)
print('Price:', detail_info.price)
print('URL:', detail_info.url)
for item in detail_info.items:
print('Image:', item.image)
print('Description:', item.description)
async def test():
resolve_date('発売日:2022年04月27日')
if __name__ == "__main__":
import asyncio
asyncio.run(main())