菜单
  • 字节-豆包AI
  • 阿里-通义AI
  • 讯飞-星火AI
  • 百度-文心AI
  • GPT-代码AI
  • 写作助手
  • 论文助手

任务一:采集唐诗三百首内容 python import requests from bs4 import beautifulsoup import pandas as pd url = "https://so.gushiwen.cn/gushi/tangshi.aspx" response = requests.get(url) soup = beautifulsoup(response.text, "html.parser") poems = [] for poem in soup.find_all("div", class_="item"): title = poem.find("h1").text.strip() content = poem.find("p").text.strip() author = poem.find("span", class_="author").text.strip() poem_type = "唐诗" poems.append(

服务器繁忙,请稍后再试 [2024-06-24 15:46:11 | GPT-代码助手 | 15字解答]

相关提问