为了账号安全,请及时绑定邮箱和手机立即绑定

终端不会使用 BeautifulSoup 显示打印响应

终端不会使用 BeautifulSoup 显示打印响应

浮云间 2021-09-11 17:44:48
这是我的代码:import requestsfrom bs4 import BeautifulSouppage = requests.get('https://web.archive.org/web/20121007172955/https://www.nga.gov/collection/anZ1.htm')soup = BeautifulSoup(page.text, 'html.parser')name_list = soup.find(class_='BodyText')name_list_item = name_list.find_all('a')for i in name_list_item:  names = name_list.contents[0]  print(names)然后我运行了它,但终端中没有显示任何内容,除了像这样的空格:
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 149 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信