操作列表与字典

2022-09-19 13:07:45

from bs4 import BeautifulSoup

books_dir=[{'name': '章节目录', 'url': 'http://www.biqukan.com/1_1094/5386268.html'},
 {'name': '外传1 柯父。', 'url': 'http://www.biqukan.com/1_1094/5386269.html'},
 {'name': '外传2 楚玉嫣。', 'url': 'http://www.biqukan.com/1_1094/5386270.html'},
 {'name': '第一章 他叫白小纯', 'url': 'http://www.biqukan.com/1_1094/5403177.html'},
 {'name': '第二章 火灶房', 'url': 'http://www.biqukan.com/1_1094/5428081.html'},
 {'name': '第三章 六句真言', 'url': 'http://www.biqukan.com/1_1094/5433843.html'}]

for i in range(0,len(books_dir)):
    print(books_dir[i]['name'])
    print(books_dir[i]['url'])

  • 作者:casanava18
  • 原文链接:https://blog.csdn.net/casanava18/article/details/90411320
    更新时间:2022-09-19 13:07:45