解析ISO网站单个标准的静态网址 import sysimport ossys.path.insert(0, os.path.join(os.path.dirname(file), ‘lib’))import requestsfrom bs4 import BeautifulSoupurl “https://www.iso.org/standard/45780.html”print(f查询网址{url})headers {“User-Agent”: “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36”,“Accept”: “text/html,application/xhtmlxml,application/xml;q0.9,image/avif,image/webp,image/apng,/;q0.8”,“Accept-Language”: “zh-CN,zh;q0.9,en;q0.8”,“Accept-Encoding”: “gzip, deflate, br”,“Referer”: “https://www.iso.org/”,“Connection”: “keep-alive”,“Upgrade-Insecure-Requests”: “1”}response requests.get(url, headersheaders)html_content response.textwith open(‘page.html’, ‘w’, encoding‘utf-8’) as f:f.write(html_content)soup BeautifulSoup(html_content, ‘html.parser’)standard_number soup.find(class_‘standard-number’)standard_title soup.find(class_‘standard-title’)print(standard_number.text.strip() standard_title.text.strip())description soup.find(itemprop‘description’)if description:print(f摘要内容)spans description.find_all(‘span’, lang‘EN-GB’)for span in spans:print(span.text.strip())lifecycle soup.find(class_‘lifecycle’)if lifecycle:print(f版本替代关系“)steps lifecycle.find_all(class_‘step-item’)for step in steps:print(f”{step.text.strip()})

相关新闻

最新新闻

Twilio Video.js 如何接入 React 和 Angular:框架集成与 SSR 完整教程

Twilio Video.js 如何接入 React 和 Angular:框架集成与 SSR 完整教程

Twilio Video.js 如何接入 React 和 Angular:框架集成与 SSR 完整教程 【免费下载链接】twilio-video.js Twilio’s Programmable Video JavaScript SDK 项目地址: https://gitcode.com/gh_mirrors/tw/twilio-video.js Twilio Video.js 是 Twilio 官方的 Pro…

2026/8/28 10:29:55
Claude Code 使用指南:把 AI 助手装进终端,3 分钟跑通日常开发

Claude Code 使用指南:把 AI 助手装进终端,3 分钟跑通日常开发

Claude Code 使用指南:把 AI 助手装进终端,3 分钟跑通日常开发 【免费下载链接】claude-code Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks,…

2026/8/28 10:29:55
如何用Transformers把多人会议录音转成文字

如何用Transformers把多人会议录音转成文字

如何用Transformers把多人会议录音转成文字 【免费下载链接】transformers 🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training. …

2026/8/28 10:29:55
C++复数计算器实现:面向对象设计、运算符重载与工程实践

C++复数计算器实现:面向对象设计、运算符重载与工程实践

1. 项目缘起:为什么我们需要一个“复杂”的复数计算器? 在工程、物理和信号处理领域,复数计算是家常便饭。无论是分析交流电路的阻抗,还是处理傅里叶变换后的频谱数据,复数都无处不在。然而,大多数通用计算…

2026/8/28 10:29:55
AI改代码实战指南:从代码审查到Agent的安全工作流

AI改代码实战指南:从代码审查到Agent的安全工作流

用 AI 改代码这件事,最常听到的两种说法是:一种说“AI 能帮我把代码写得更优雅”,另一种说“AI 生成的东西根本不能用”。我实际跑过一段时间之后,结论更偏中间:AI 确实能把代码改好,但前提是你得把它当成一…

2026/8/28 10:29:55
Unofficial Cosmos.so MCP接入实战:让AI调用你的灵感库

Unofficial Cosmos.so MCP接入实战:让AI调用你的灵感库

Unofficial Cosmos.so MCP 接入实战:把创意灵感库变成 AI 可调用的数据源 MCP(Model Context Protocol)最近几乎成了 AI 应用接入外部数据的事实标准。从 Claude Desktop、Cursor、Dify,到各种支持 MCP Server 的编程工具&#x…

2026/8/28 10:24:55