【作业批改】task-2-1 数据采集 - 需修改 #1

Closed
opened 2026-03-23 23:29:05 +08:00 by gitea_eternal · 0 comments

作业批改结果:需修改 ⚠️

提交文件

  • 李佳浩.py

问题

  • 文件内容不完整:只有BeautifulSoup解析部分,缺少requests爬取代码,变量 html_content 未定义

建议

添加完整的爬虫代码:

import requests
from bs4 import BeautifulSoup

url = 'https://example.com'
response = requests.get(url)
html_content = response.text

soup = BeautifulSoup(html_content, 'lxml')
title = soup.find('title').string
print("页面标题:", title)

得分

60/100


学期间多次未完成作业将影响期末成绩。

## 作业批改结果:需修改 ⚠️ ### 提交文件 - 李佳浩.py ### 问题 - **文件内容不完整**:只有BeautifulSoup解析部分,缺少requests爬取代码,变量 `html_content` 未定义 ### 建议 添加完整的爬虫代码: ```python import requests from bs4 import BeautifulSoup url = 'https://example.com' response = requests.get(url) html_content = response.text soup = BeautifulSoup(html_content, 'lxml') title = soup.find('title').string print("页面标题:", title) ``` ### 得分 60/100 --- 学期间多次未完成作业将影响期末成绩。
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: 2509165033/task-2-1-data-collection#1
No description provided.