当前位置:首页 > 文章列表 > 文章 > python教程 > BeautifulSoup提取HTML生成新文档方法

BeautifulSoup提取HTML生成新文档方法

2025-10-25 09:18:29 0浏览 收藏

亲爱的编程学习爱好者,如果你点开了这篇文章,说明你对《用BeautifulSoup提取HTML并生成新文档》很感兴趣。本篇文章就来给大家详细解析一下,主要介绍一下,希望所有认真读完的童鞋们,都有实质性的提高。

使用BeautifulSoup选择性提取HTML元素并构建新HTML文档

本文详细介绍了如何利用Python的BeautifulSoup库,从现有HTML文件中高效地提取指定标签及其内容,并构建一个新的HTML文档。通过迭代预定义的标签筛选规则,结合BeautifulSoup的find方法和append功能,我们能够避免繁琐的字符串拼接,实现更简洁、更具可维护性的HTML元素筛选与重构。

挑战:传统字符串拼接的局限性

在处理HTML文档时,我们经常需要从一个现有页面中提取特定部分,并将其组合成一个新的HTML文件。一种直观但效率不高的方法是,使用BeautifulSoup解析原始HTML,然后手动提取每个目标元素的字符串表示,并通过字符串拼接的方式构建新页面的HTML内容。例如:

from bs4 import BeautifulSoup

with open('P:/Test.html', 'r') as f:
    contents = f.read()
    soup= BeautifulSoup(contents, 'html.parser')

NewHTML = ""
NewHTML+="\n"+str(soup.find('title'))
NewHTML+="\n"+str(soup.find('p', attrs={'class': 'm-b-0'}))
NewHTML+="\n"+str(soup.find('div', attrs={'id' :'right-col'}))
NewHTML+= ""

with open("output1.html", "w") as file:
    file.write(NewHTML)

这种方法虽然能够实现目标,但存在明显的局限性:

  1. 可维护性差:当需要提取的元素数量增多或结构变得复杂时,手动拼接字符串会变得异常繁琐且容易出错。
  2. 非BeautifulSoup惯用方式:BeautifulSoup提供了强大的API来操作HTML树结构,直接拼接字符串未能充分利用这些功能。
  3. 潜在的解析问题:手动拼接可能导致HTML结构不完整或格式不正确,尤其是在处理包含特殊字符或嵌套结构的元素时。

为了解决这些问题,我们可以采用BeautifulSoup提供的方法,以更优雅和健壮的方式构建新的HTML文档。

核心策略:BeautifulSoup的元素操作

BeautifulSoup允许我们像操作DOM一样操作HTML元素。其关键在于:

  1. 创建新的BeautifulSoup对象:将其作为新HTML文档的容器。
  2. 利用find()或find_all()定位元素:在原始HTML中找到需要提取的元素。
  3. 使用append()方法追加元素:将找到的元素(BeautifulSoup Tag对象)直接添加到新HTML文档的相应位置(如body标签内)。

这种方法避免了字符串层面的操作,直接在BeautifulSoup的解析树层面进行,确保了HTML结构的正确性和一致性。

实现步骤详解

下面将详细介绍如何通过BeautifulSoup的append方法,选择性地从一个HTML页面中提取特定标签并构建一个新的HTML文件。

1. 加载源HTML文档

首先,我们需要读取并解析包含源内容的HTML文件。

from bs4 import BeautifulSoup

# 假设原始HTML文件名为 'Test.html'
with open('Test.html', 'r', encoding='utf-8') as f:
    contents = f.read()
    soup = BeautifulSoup(contents, 'html.parser')

注意:为了避免编码问题,建议在打开文件时明确指定编码,例如encoding='utf-8'。

2. 初始化目标HTML结构

创建一个新的BeautifulSoup对象,作为我们即将构建的新HTML文档的骨架。通常,我们会从一个基本的结构开始。

new_html = BeautifulSoup("", 'html.parser')

此时,new_html是一个空的HTML文档结构,其body标签是我们可以向其中追加元素的根节点。

3. 定义元素筛选规则

为了灵活地选择需要保留的元素,我们可以定义一个列表,其中包含要提取的标签名称或带有属性的标签信息。

  • 对于仅按标签名筛选的元素,可以直接使用字符串。
  • 对于需要按标签名和属性筛选的元素,可以使用字典,键为标签名,值为属性字典。
tags_to_keep = [
    'title',                               # 提取  标签
    {'p': {'class': 'm-b-0'}},             # 提取 class 为 'm-b-0' 的 <p> 标签
    {'div': {'id': 'right-col'}}           # 提取 id 为 'right-col' 的 <div> 标签
]</pre><h4>4. 迭代筛选并追加元素</h4><p>遍历tags_to_keep列表。根据每个元素的类型(字符串或字典),使用soup.find()方法在原始soup对象中查找对应的元素,然后将其追加到new_html.body中。</p><pre class="brush:php;toolbar:false">for tag_rule in tags_to_keep:
    found_element = None
    if isinstance(tag_rule, str):
        # 如果是字符串,按标签名查找
        found_element = soup.find(tag_rule)
    elif isinstance(tag_rule, dict):
        # 如果是字典,提取标签名和属性进行查找
        tag_name = list(tag_rule.keys())[0]
        tag_attrs = tag_rule[tag_name]
        found_element = soup.find(tag_name, attrs=tag_attrs)

    # 检查是否找到元素,避免追加 None
    if found_element:
        new_html.body.append(found_element)</pre><h4>5. 保存新HTML文件</h4><p>最后,将构建好的new_html对象转换为字符串,并写入到一个新的HTML文件中。</p><pre class="brush:php;toolbar:false">with open("output1.html", "w", encoding='utf-8') as file:
    file.write(str(new_html))</pre><h3>示例代码</h3><p>将上述步骤整合到一起,完整的实现代码如下:</p><pre class="brush:php;toolbar:false">from bs4 import BeautifulSoup

# 1. 加载源HTML文档
with open('Test.html', 'r', encoding='utf-8') as f:
    contents = f.read()
    soup = BeautifulSoup(contents, 'html.parser')

# 2. 初始化目标HTML结构
new_html = BeautifulSoup("<html><body></body></html>", 'html.parser')

# 3. 定义元素筛选规则
tags_to_keep = [
    'title',                               # 提取 <title> 标签
    {'p': {'class': 'm-b-0'}},             # 提取 class 为 'm-b-0' 的 <p> 标签
    {'div': {'id': 'right-col'}}           # 提取 id 为 'right-col' 的 <div> 标签
]

# 4. 迭代筛选并追加元素
for tag_rule in tags_to_keep:
    found_element = None
    if isinstance(tag_rule, str):
        # 如果是字符串,按标签名查找
        found_element = soup.find(tag_rule)
    elif isinstance(tag_rule, dict):
        # 如果是字典,提取标签名和属性进行查找
        tag_name = list(tag_rule.keys())[0]
        tag_attrs = tag_rule[tag_name]
        found_element = soup.find(tag_name, attrs=tag_attrs)

    # 检查是否找到元素,避免追加 None
    if found_element:
        # Beautiful Soup的append方法会将元素及其所有子元素一并追加
        new_html.body.append(found_element)

# 5. 保存新HTML文件
with open("output1.html", "w", encoding='utf-8') as file:
    file.write(str(new_html))

print("新HTML文件 'output1.html' 已生成。")</pre><h3>源HTML示例</h3><p>为了更好地理解上述代码的运行效果,假设Test.html文件内容如下:</p><pre class="brush:php;toolbar:false"><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>测试页面


    

这是一个标题

这是一个带有特定类名的段落。

左侧列内容。

右侧列内容。

更多右侧内容。

这是另一个普通段落。

生成结果预览

运行上述Python代码后,output1.html文件将包含以下内容:


 
  
   测试页面
  
  

这是一个带有特定类名的段落。

右侧列内容。

更多右侧内容。

可以看到,原始页面中的、带有class="m-b-0"的<p>标签以及带有id="right-col"的<div>标签及其所有子元素都被成功提取并组合到了新的HTML文件中。</p><h3>注意事项与进阶考量</h3><ol><li><p><strong>处理未找到的元素</strong>:soup.find()在找不到匹配元素时会返回None。在追加之前进行if found_element:检查是良好的编程习惯,可以避免将None对象添加到HTML树中,从而导致潜在的错误或不完整的输出。</p></li><li><p><strong>选择多个匹配项 (find_all)</strong>:如果需要提取所有符合条件的元素,而不是第一个匹配项,应使用soup.find_all()方法。find_all()会返回一个BeautifulSoup Tag对象的列表,你需要遍历这个列表,并将每个找到的元素逐一追加到新HTML文档中。</p><pre class="brush:php;toolbar:false"># 示例:提取所有 <p> 标签 all_paragraphs = soup.find_all('p') for p_tag in all_paragraphs: new_html.body.append(p_tag)</pre></li><li><p><strong>构建复杂新结构</strong>:本教程示例将所有元素追加到body标签下。如果需要构建更复杂的HTML结构(例如,将某些元素放入head,另一些放入body的特定div中),你需要创建更多的BeautifulSoup Tag对象,并使用append()、insert()等方法将元素放置到精确的位置。</p></li><li><p><strong>编码问题</strong>:在读取和写入文件时,务必注意文件编码。通常推荐使用utf-8。</p></li><li><p><strong>性能考量</strong>:对于非常大的HTML文件和大量的提取操作,BeautifulSoup的解析和操作可能会消耗较多内存和时间。在极端情况下,可以考虑其他更底层的HTML解析库,但对于大多数网页抓取和处理任务,BeautifulSoup的性能是完全足够的。</p></li></ol><h3>总结</h3><p>通过利用BeautifulSoup的内部机制,我们可以以一种声明式和结构化的方式从现有HTML文档中提取并重构新的HTML内容。这种方法不仅代码更简洁、更易于理解和维护,而且能够确保生成的HTML结构是有效的。掌握find()、find_all()和append()等核心方法,将大大提高你在Python中处理HTML文档的效率和健壮性。</p><p>今天关于《BeautifulSoup提取HTML生成新文档方法》的内容介绍就到此结束,如果有什么疑问或者建议,可以在golang学习网公众号下多多回复交流;文中若有不正之处,也希望回复留言以告知!</p> </div> <div class="labsList"> </div> <div class="cateBox"> <div class="cateItem"> <a href="/article/358964.html" title="哔哩哔哩直播回放怎么查看" class="img_box"> <img src="/uploads/20251025/176135510968fc25650556c.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="哔哩哔哩直播回放怎么查看">哔哩哔哩直播回放怎么查看 </a> <dl> <dt class="lineOverflow"><a href="/article/358964.html" title="哔哩哔哩直播回放怎么查看" class="aBlack">上一篇<i></i></a></dt> <dd class="lineTwoOverflow">哔哩哔哩直播回放怎么查看</dd> </dl> </div> <div class="cateItem"> <a href="/article/358966.html" title="最长连续相同元素查找技巧" class="img_box"> <img src="/uploads/20251025/176135511168fc2567dfd95.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="最长连续相同元素查找技巧"> </a> <dl> <dt class="lineOverflow"><a href="/article/358966.html" class="aBlack" title="最长连续相同元素查找技巧">下一篇<i></i></a></dt> <dd class="lineTwoOverflow">最长连续相同元素查找技巧</dd> </dl> </div> </div> </div> </div> <div class="leftContBox pt0"> <div class="pdl20"> <div class="contTit"> <a href="/articlelist.html" class="more" title="查看更多">查看更多<i class="iconfont"></i></a> <div class="tit">最新文章</div> </div> </div> <ul class="newArticleList"> <li> <div class="contBox"> <a href="/article/630489.html" class="img_box" title="Python Protocol 怎样描述带异步方法的结构类型"> <img src="/uploads/20261009/1791535792-27142c5f38-de0db94fbb-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Python Protocol 怎样描述带异步方法的结构类型"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  1小时前  |   <a href="/articletag/39719_new_0_1.html" class="aLightGray" title="Python教程">Python教程</a> · <a href="javascript:;" class="aLightGray" title="静态类型检查">静态类型检查</a> <a href="javascript:;" class="aLightGray" title="异步方法">异步方法</a> <a href="javascript:;" class="aLightGray" title="Python Protocol">Python Protocol</a> <a href="javascript:;" class="aLightGray" title="结构类型">结构类型</a> <a href="javascript:;" class="aLightGray" title="Awaitable">Awaitable</a> </span> </dd> <dt class="lineOverflow"> <a href="/article/630489.html" class="aBlack" target="_blank" title="Python Protocol 怎样描述带异步方法的结构类型">Python Protocol 怎样描述带异步方法的结构类型</a> </dt> <dd class="cont2"> <span><i class="view"></i>363浏览</span> <span class="collectBtn user_collection" data-id="630489" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630462.html" class="img_box" title="Python dataclasses.replace 遇到 InitVar 时怎样传递参数"> <img src="/uploads/20261009/1791526549-c2e9cd5dbf-84ae501d5a-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Python dataclasses.replace 遇到 InitVar 时怎样传递参数"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  3小时前  |   <a href="/articletag/39719_new_0_1.html" class="aLightGray" title="Python教程">Python教程</a> · <a href="javascript:;" class="aLightGray" title="InitVar">InitVar</a> <a href="javascript:;" class="aLightGray" title="__post_init__">__post_init__</a> <a href="javascript:;" class="aLightGray" title="Python dataclasses.replace">Python dataclasses.replace</a> <a href="javascript:;" class="aLightGray" title="数据类复制">数据类复制</a> </span> </dd> <dt class="lineOverflow"> <a href="/article/630462.html" class="aBlack" target="_blank" title="Python dataclasses.replace 遇到 InitVar 时怎样传递参数">Python dataclasses.replace 遇到 InitVar 时怎样传递参数</a> </dt> <dd class="cont2"> <span><i class="view"></i>381浏览</span> <span class="collectBtn user_collection" data-id="630462" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630437.html" class="img_box" title="Python importlib.resources.as_file 的临时路径何时失效"> <img src="/uploads/20261009/1791518861-a1ddf9ed59-6d86c5378e-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Python importlib.resources.as_file 的临时路径何时失效"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  5小时前  |   <a href="/articletag/2337_new_0_1.html" class="aLightGray" title="python">python</a> · <a href="/articletag/39791_new_0_1.html" class="aLightGray" title="pathlib">pathlib</a> · </span> </dd> <dt class="lineOverflow"> <a href="/article/630437.html" class="aBlack" target="_blank" title="Python importlib.resources.as_file 的临时路径何时失效">Python importlib.resources.as_file 的临时路径何时失效</a> </dt> <dd class="cont2"> <span><i class="view"></i>318浏览</span> <span class="collectBtn user_collection" data-id="630437" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630414.html" class="img_box" title="Python sqlite3 备份进度回调怎样判断剩余页数"> <img src="/uploads/20261009/1791511192-86a3899e8b-4be331a912-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Python sqlite3 备份进度回调怎样判断剩余页数"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  8小时前  |   <a href="/articletag/3981_new_0_1.html" class="aLightGray" title="SQLite">SQLite</a> · <a href="/articletag/39719_new_0_1.html" class="aLightGray" title="Python教程">Python教程</a> · <a href="javascript:;" class="aLightGray" title="Python">Python</a> <a href="javascript:;" class="aLightGray" title="sqlite3">sqlite3</a> <a href="javascript:;" class="aLightGray" title="Connection.backup">Connection.backup</a> <a href="javascript:;" class="aLightGray" title="进度回调">进度回调</a> <a href="javascript:;" class="aLightGray" title="SQLite备份">SQLite备份</a> </span> </dd> <dt class="lineOverflow"> <a href="/article/630414.html" class="aBlack" target="_blank" title="Python sqlite3 备份进度回调怎样判断剩余页数">Python sqlite3 备份进度回调怎样判断剩余页数</a> </dt> <dd class="cont2"> <span><i class="view"></i>264浏览</span> <span class="collectBtn user_collection" data-id="630414" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630389.html" class="img_box" title="Python mmap 怎样分段处理超过内存的大文件"> <img src="/uploads/20261009/1791503351-c9428e1322-835497744d-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Python mmap 怎样分段处理超过内存的大文件"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  10小时前  |   <a href="/articletag/2337_new_0_1.html" class="aLightGray" title="python">python</a> · <a href="/articletag/39694_new_0_1.html" class="aLightGray" title="内存优化">内存优化</a> · <a href="/articletag/39719_new_0_1.html" class="aLightGray" title="Python教程">Python教程</a> · <a href="javascript:;" class="aLightGray" title="文件读取">文件读取</a> <a href="javascript:;" class="aLightGray" title="大文件处理">大文件处理</a> <a href="javascript:;" class="aLightGray" title="Python mmap">Python mmap</a> <a href="javascript:;" class="aLightGray" title="分段映射">分段映射</a> <a href="javascript:;" class="aLightGray" title="ALLOCATIONGRANULARITY">ALLOCATIONGRANULARITY</a> </span> </dd> <dt class="lineOverflow"> <a href="/article/630389.html" class="aBlack" target="_blank" title="Python mmap 怎样分段处理超过内存的大文件">Python mmap 怎样分段处理超过内存的大文件</a> </dt> <dd class="cont2"> <span><i class="view"></i>146浏览</span> <span class="collectBtn user_collection" data-id="630389" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630365.html" class="img_box" title="Python memoryview 如何零拷贝切片二进制协议数据"> <img src="/uploads/20261009/1791495837-f456899c18-71831a9ac6-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Python memoryview 如何零拷贝切片二进制协议数据"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  12小时前  |   <a href="/articletag/2337_new_0_1.html" class="aLightGray" title="python">python</a> · <a href="javascript:;" class="aLightGray" title="Python">Python</a> <a href="javascript:;" class="aLightGray" title="二进制协议">二进制协议</a> <a href="javascript:;" class="aLightGray" title="零拷贝">零拷贝</a> <a href="javascript:;" class="aLightGray" title="memoryview">memoryview</a> </span> </dd> <dt class="lineOverflow"> <a href="/article/630365.html" class="aBlack" target="_blank" title="Python memoryview 如何零拷贝切片二进制协议数据">Python memoryview 如何零拷贝切片二进制协议数据</a> </dt> <dd class="cont2"> <span><i class="view"></i>225浏览</span> <span class="collectBtn user_collection" data-id="630365" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630341.html" class="img_box" title="Python asyncio.Condition.wait_for 如何处理虚假唤醒"> <img src="/uploads/20261009/1791488419-acd4f3a057-72591c48cd-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Python asyncio.Condition.wait_for 如何处理虚假唤醒"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  14小时前  |   <a href="/articletag/1650_new_0_1.html" class="aLightGray" title="并发控制">并发控制</a> · <a href="/articletag/39719_new_0_1.html" class="aLightGray" title="Python教程">Python教程</a> · <a href="/articletag/39720_new_0_1.html" class="aLightGray" title="asyncio">asyncio</a> · <a href="javascript:;" class="aLightGray" title="虚假唤醒">虚假唤醒</a> <a href="javascript:;" class="aLightGray" title="wait_for">wait_for</a> <a href="javascript:;" class="aLightGray" title="Python asyncio">Python asyncio</a> <a href="javascript:;" class="aLightGray" title="asyncio.Condition">asyncio.Condition</a> <a href="javascript:;" class="aLightGray" title="异步同步">异步同步</a> </span> </dd> <dt class="lineOverflow"> <a href="/article/630341.html" class="aBlack" target="_blank" title="Python asyncio.Condition.wait_for 如何处理虚假唤醒">Python asyncio.Condition.wait_for 如何处理虚假唤醒</a> </dt> <dd class="cont2"> <span><i class="view"></i>478浏览</span> <span class="collectBtn user_collection" data-id="630341" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630317.html" class="img_box" title="Python ExceptionGroup 派生新组时如何保留异常元数据"> <img src="/uploads/20261009/1791480594-5de2861ec3-7f533d26c0-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Python ExceptionGroup 派生新组时如何保留异常元数据"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  16小时前  |   </span> </dd> <dt class="lineOverflow"> <a href="/article/630317.html" class="aBlack" target="_blank" title="Python ExceptionGroup 派生新组时如何保留异常元数据">Python ExceptionGroup 派生新组时如何保留异常元数据</a> </dt> <dd class="cont2"> <span><i class="view"></i>417浏览</span> <span class="collectBtn user_collection" data-id="630317" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630294.html" class="img_box" title="Python TaskGroup 如何汇总多个子任务异常"> <img src="/uploads/20261008/1791474973-5fdad13b47-e5c6728b4a-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Python TaskGroup 如何汇总多个子任务异常"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  18小时前  |   <a href="/articletag/1031_new_0_1.html" class="aLightGray" title="异常处理">异常处理</a> · <a href="/articletag/1138_new_0_1.html" class="aLightGray" title="并发编程">并发编程</a> · <a href="/articletag/39719_new_0_1.html" class="aLightGray" title="Python教程">Python教程</a> · <a href="/articletag/39720_new_0_1.html" class="aLightGray" title="asyncio">asyncio</a> · <a href="javascript:;" class="aLightGray" title="asyncio">asyncio</a> <a href="javascript:;" class="aLightGray" title="结构化并发">结构化并发</a> <a href="javascript:;" class="aLightGray" title="ExceptionGroup">ExceptionGroup</a> <a href="javascript:;" class="aLightGray" title="except*">except*</a> <a href="javascript:;" class="aLightGray" title="Python TaskGroup">Python TaskGroup</a> </span> </dd> <dt class="lineOverflow"> <a href="/article/630294.html" class="aBlack" target="_blank" title="Python TaskGroup 如何汇总多个子任务异常">Python TaskGroup 如何汇总多个子任务异常</a> </dt> <dd class="cont2"> <span><i class="view"></i>208浏览</span> <span class="collectBtn user_collection" data-id="630294" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630258.html" class="img_box" title="Python 日志 QueueHandler 解决多进程写入争用"> <img src="/uploads/20261008/1791461511-75fb64b1ad-8d4456a483-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Python 日志 QueueHandler 解决多进程写入争用"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  21小时前  |   <a href="/articletag/1138_new_0_1.html" class="aLightGray" title="并发编程">并发编程</a> · <a href="/articletag/39701_new_0_1.html" class="aLightGray" title="工程实践">工程实践</a> · <a href="/articletag/39719_new_0_1.html" class="aLightGray" title="Python教程">Python教程</a> · <a href="javascript:;" class="aLightGray" title="多进程日志">多进程日志</a> <a href="javascript:;" class="aLightGray" title="QueueListener">QueueListener</a> <a href="javascript:;" class="aLightGray" title="multiprocessing.Queue">multiprocessing.Queue</a> <a href="javascript:;" class="aLightGray" title="RotatingFileHandler">RotatingFileHandler</a> <a href="javascript:;" class="aLightGray" title="Python QueueHandler">Python QueueHandler</a> </span> </dd> <dt class="lineOverflow"> <a href="/article/630258.html" class="aBlack" target="_blank" title="Python 日志 QueueHandler 解决多进程写入争用">Python 日志 QueueHandler 解决多进程写入争用</a> </dt> <dd class="cont2"> <span><i class="view"></i>186浏览</span> <span class="collectBtn user_collection" data-id="630258" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630234.html" class="img_box" title="Pydantic 模型更新时区分未提供字段与显式空值"> <img src="/uploads/20261008/1791453226-a5d274f0a5-e28e060fdd-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Pydantic 模型更新时区分未提供字段与显式空值"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  1天前  |   <a href="/articletag/852_new_0_1.html" class="aLightGray" title="数据校验">数据校验</a> · <a href="/articletag/2337_new_0_1.html" class="aLightGray" title="python">python</a> · <a href="javascript:;" class="aLightGray" title="Pydantic 部分更新">Pydantic 部分更新</a> <a href="javascript:;" class="aLightGray" title="exclude_unset">exclude_unset</a> <a href="javascript:;" class="aLightGray" title="model_fields_set">model_fields_set</a> <a href="javascript:;" class="aLightGray" title="显式空值">显式空值</a> <a href="javascript:;" class="aLightGray" title="model_dump">model_dump</a> </span> </dd> <dt class="lineOverflow"> <a href="/article/630234.html" class="aBlack" target="_blank" title="Pydantic 模型更新时区分未提供字段与显式空值">Pydantic 模型更新时区分未提供字段与显式空值</a> </dt> <dd class="cont2"> <span><i class="view"></i>399浏览</span> <span class="collectBtn user_collection" data-id="630234" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630210.html" class="img_box" title="pytest Fixture 作用域如何影响测试隔离与速度"> <img src="/uploads/20261008/1791445131-154e755dba-fffe00028a-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="pytest Fixture 作用域如何影响测试隔离与速度"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  1天前  |   </span> </dd> <dt class="lineOverflow"> <a href="/article/630210.html" class="aBlack" target="_blank" title="pytest Fixture 作用域如何影响测试隔离与速度">pytest Fixture 作用域如何影响测试隔离与速度</a> </dt> <dd class="cont2"> <span><i class="view"></i>341浏览</span> <span class="collectBtn user_collection" data-id="630210" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> </ul> </div> </div> <div class="mainRight"> <!-- 右侧广告位banner --> <div class="rightContBox" style="margin-top: 0px;"> <div class="rightTit"> <a href="/courselist.html" class="more" title="查看更多">查看更多<i class="iconfont"></i></a> <div class="tit lineOverflow">课程推荐</div> </div> <ul class="lessonRecomRList"> <li> <a href="/course/9.html" class="img_box" target="_blank" title="前端进阶之JavaScript设计模式"> <img src="/uploads/20221222/52fd0f23a454c71029c2c72d206ed815.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="前端进阶之JavaScript设计模式"> </a> <dl> <dt class="lineTwoOverflow"><a href="/course/9.html" target="_blank" class="aBlack" title="前端进阶之JavaScript设计模式">前端进阶之JavaScript设计模式</a></dt> <dd class="cont1 lineTwoOverflow"> 设计模式是开发人员在软件开发过程中面临一般问题时的解决方案,代表了最佳的实践。本课程的主打内容包括JS常见设计模式以及具体应用场景,打造一站式知识长龙服务,适合有JS基础的同学学习。 </dd> <dd class="cont2">543次学习</dd> </dl> </li> <li> <a href="/course/2.html" class="img_box" target="_blank" title="GO语言核心编程课程"> <img src="/uploads/20221221/634ad7404159bfefc6a54a564d437b5f.png" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="GO语言核心编程课程"> </a> <dl> <dt class="lineTwoOverflow"><a href="/course/2.html" target="_blank" class="aBlack" title="GO语言核心编程课程">GO语言核心编程课程</a></dt> <dd class="cont1 lineTwoOverflow"> 本课程采用真实案例,全面具体可落地,从理论到实践,一步一步将GO核心编程技术、编程思想、底层实现融会贯通,使学习者贴近时代脉搏,做IT互联网时代的弄潮儿。 </dd> <dd class="cont2">516次学习</dd> </dl> </li> <li> <a href="/course/74.html" class="img_box" target="_blank" title="简单聊聊mysql8与网络通信"> <img src="/uploads/20240103/bad35fe14edbd214bee16f88343ac57c.png" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="简单聊聊mysql8与网络通信"> </a> <dl> <dt class="lineTwoOverflow"><a href="/course/74.html" target="_blank" class="aBlack" title="简单聊聊mysql8与网络通信">简单聊聊mysql8与网络通信</a></dt> <dd class="cont1 lineTwoOverflow"> 如有问题加微信:Le-studyg;在课程中,我们将首先介绍MySQL8的新特性,包括性能优化、安全增强、新数据类型等,帮助学生快速熟悉MySQL8的最新功能。接着,我们将深入解析MySQL的网络通信机制,包括协议、连接管理、数据传输等,让 </dd> <dd class="cont2">500次学习</dd> </dl> </li> <li> <a href="/course/57.html" class="img_box" target="_blank" title="JavaScript正则表达式基础与实战"> <img src="/uploads/20221226/bbe4083bb3cb0dd135fb02c31c3785fb.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="JavaScript正则表达式基础与实战"> </a> <dl> <dt class="lineTwoOverflow"><a href="/course/57.html" target="_blank" class="aBlack" title="JavaScript正则表达式基础与实战">JavaScript正则表达式基础与实战</a></dt> <dd class="cont1 lineTwoOverflow"> 在任何一门编程语言中,正则表达式,都是一项重要的知识,它提供了高效的字符串匹配与捕获机制,可以极大的简化程序设计。 </dd> <dd class="cont2">487次学习</dd> </dl> </li> <li> <a href="/course/28.html" class="img_box" target="_blank" title="从零制作响应式网站—Grid布局"> <img src="/uploads/20221223/ac110f88206daeab6c0cf38ebf5fe9ed.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="从零制作响应式网站—Grid布局"> </a> <dl> <dt class="lineTwoOverflow"><a href="/course/28.html" target="_blank" class="aBlack" title="从零制作响应式网站—Grid布局">从零制作响应式网站—Grid布局</a></dt> <dd class="cont1 lineTwoOverflow"> 本系列教程将展示从零制作一个假想的网络科技公司官网,分为导航,轮播,关于我们,成功案例,服务流程,团队介绍,数据部分,公司动态,底部信息等内容区块。网站整体采用CSSGrid布局,支持响应式,有流畅过渡和展现动画。 </dd> <dd class="cont2">485次学习</dd> </dl> </li> </ul> </div> <div class="rightContBox"> <div class="rightTit"> <a href="/ai.html" class="more" title="查看更多">查看更多<i class="iconfont"></i></a> <div class="tit lineOverflow">AI推荐</div> </div> <ul class="lessonRecomRList"> <li> <a href="/ai/13900.html" target="_blank" title="PubMedQA数据集详解:生物医学问答基准、功能与应用指南" class="img_box"> <img src="/uploads/20260908/6a9f83280940e7.65575695.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="PubMedQA数据集详解:生物医学问答基准、功能与应用指南" style="object-fit:cover;width:100%;height:100%;"> </a> <dl> <dt class="lineTwoOverflow"><a href="/ai/13900.html" class="aBlack" target="_blank" title="PubMedQA">PubMedQA</a></dt> <dd class="cont1 lineTwoOverflow"> 深入了解PubMedQA生物医学问答数据集,涵盖其核心功能、使用方法及在临床决策、药物研发等场景的应用,助力提升NLP模型性能。 </dd> <dd class="cont2">393次使用</dd> </dl> </li> <li> <a href="/ai/13899.html" target="_blank" title="H2O EvalGPT:开源LLM大模型评估与排行榜工具" class="img_box"> <img src="/uploads/20260908/17887986376a9ee6adaf3f5.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="H2O EvalGPT:开源LLM大模型评估与排行榜工具" style="object-fit:cover;width:100%;height:100%;"> </a> <dl> <dt class="lineTwoOverflow"><a href="/ai/13899.html" class="aBlack" target="_blank" title="H2O EvalGPT">H2O EvalGPT</a></dt> <dd class="cont1 lineTwoOverflow"> H2O EvalGPT是H2O.ai推出的开源LLM评估平台,提供详细的大模型性能排行榜、行业特定基准测试及A/B测试功能,助您快速选择最适合项目的高性能大语言模型。 </dd> <dd class="cont2">471次使用</dd> </dl> </li> <li> <a href="/ai/13898.html" target="_blank" title="LMArena是什么?伯克利AI模型评估平台使用指南与功能解析" class="img_box"> <img src="/uploads/20260908/6a9f862dbcfec7.27385604.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="LMArena是什么?伯克利AI模型评估平台使用指南与功能解析" style="object-fit:cover;width:100%;height:100%;"> </a> <dl> <dt class="lineTwoOverflow"><a href="/ai/13898.html" class="aBlack" target="_blank" title="LMArena">LMArena</a></dt> <dd class="cont1 lineTwoOverflow"> LMArena是加州大学伯克利分校推出的AI模型匿名评测平台。通过盲测投票机制,用户可对比不同大模型回答并生成实时排行榜,助力开发者优化模型及用户选择最佳AI工具。 </dd> <dd class="cont2">478次使用</dd> </dl> </li> <li> <a href="/ai/13897.html" target="_blank" title="斯坦福HELM:大语言模型Holistic Evaluation整体评估框架详解" class="img_box"> <img src="/uploads/20260908/6a9f86b31ed789.06773114.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="斯坦福HELM:大语言模型Holistic Evaluation整体评估框架详解" style="object-fit:cover;width:100%;height:100%;"> </a> <dl> <dt class="lineTwoOverflow"><a href="/ai/13897.html" class="aBlack" target="_blank" title="HELM">HELM</a></dt> <dd class="cont1 lineTwoOverflow"> 深入了解斯坦福推出的HELM(Holistic Evaluation of Language Models)大模型评测体系。本文解析其核心功能、安装配置步骤及应用场景,涵盖准确性、公平性、鲁棒性等多维度指标,助力开发者全面优化语言模型性能。 </dd> <dd class="cont2">421次使用</dd> </dl> </li> <li> <a href="/ai/13896.html" target="_blank" title="MMBench详解:多模态大模型基准测试、功能特点与使用指南" class="img_box"> <img src="/uploads/20260908/6a9f86d3eed3e7.18564236.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="MMBench详解:多模态大模型基准测试、功能特点与使用指南" style="object-fit:cover;width:100%;height:100%;"> </a> <dl> <dt class="lineTwoOverflow"><a href="/ai/13896.html" class="aBlack" target="_blank" title="MMBench">MMBench</a></dt> <dd class="cont1 lineTwoOverflow"> MMBench是由上海人工智能实验室等机构联合推出的多模态基准测试平台,提供细粒度能力评估、大规模数据集及VLMEvalKit工具。本文详细介绍其核心功能、安装使用方法及应用场景,助力开发者全面评估多模态模型性能。 </dd> <dd class="cont2">247次使用</dd> </dl> </li> </ul> </div> <!-- 相关文章 --> <div class="rightContBox"> <div class="rightTit"> <a href="/articlelist.html" class="more" title="查看更多">查看更多<i class="iconfont"></i></a> <div class="tit lineOverflow">相关文章</div> </div> <ul class="aboutArticleRList"> <li> <dl> <dt class="lineTwoOverflow"><a href="/article/622385.html" class="aBlack" title="Python sqlite3 Connection serialize 怎么导出数据库快照:备份窗口、内存占用与恢复校验">Python sqlite3 Connection serialize 怎么导出数据库快照:备份窗口、内存占用与恢复校验</a></dt> <dd> <span class="left">2026-08-26</span> <span class="right">501浏览</span> </dd> </dl> </li> <li> <dl> <dt class="lineTwoOverflow"><a href="/article/616032.html" class="aBlack" title="Python监控网页状态:requests异常处理实战">Python监控网页状态:requests异常处理实战</a></dt> <dd> <span class="left">2026-05-29</span> <span class="right">501浏览</span> </dd> </dl> </li> <li> <dl> <dt class="lineTwoOverflow"><a href="/article/612350.html" class="aBlack" title="TensorFlow模型部署为API的TF Serving方法">TensorFlow模型部署为API的TF Serving方法</a></dt> <dd> <span class="left">2026-05-26</span> <span class="right">501浏览</span> </dd> </dl> </li> <li> <dl> <dt class="lineTwoOverflow"><a href="/article/602477.html" class="aBlack" title="Python字符串编码转换:encode与decode详解">Python字符串编码转换:encode与decode详解</a></dt> <dd> <span class="left">2026-05-16</span> <span class="right">501浏览</span> </dd> </dl> </li> <li> <dl> <dt class="lineTwoOverflow"><a href="/article/602019.html" class="aBlack" title="TensorFlow裁剪无用算子方法详解">TensorFlow裁剪无用算子方法详解</a></dt> <dd> <span class="left">2026-05-15</span> <span class="right">501浏览</span> </dd> </dl> </li> </ul> </div> </div> </div> <div class="footer"> <div class="footerIn"> <div class="footLeft"> <div class="linkBox"> <a href="/about/1.html" target="_blank" class="aBlack" title="关于我们">关于我们</a> <a href="/about/5.html" target="_blank" class="aBlack" title="免责声明">免责声明</a> <a href="#" class="aBlack" title="意见反馈">意见反馈</a> <a href="/about/2.html" class="aBlack" target="_blank" title="联系我们">联系我们</a> <a href="/send.html" class="aBlack" title="广告合作">内容提交</a> <a href="/manual/go/" target="_blank" class="aBlack" title="手册">手册</a> </div> <div class="footTip">Golang学习网:公益在线Go学习平台,帮助Go学习者快速成长!</div> <div class="shareBox"> <span><i class="qq"></i>技术交流群</span> </div> <div class="copyRight"> Copyright 2023 http://www.17golang.com/ All Rights Reserved | <a href="https://beian.miit.gov.cn/" target="_blank" title="备案">湘ICP备19018815号-4</a> </div> </div> <div class="footRight"> <ul class="encodeList"> <li> <div class="encodeImg"> <img src="/assets/examples/qrcode_for_gh.jpg" alt="Golang学习网"> </div> <div class="tit">关注公众号</div> <div class="tip">Golang学习网</div> </li> <div class="clear"></div> </ul> </div> <div class="clear"></div> </div> </div> <!-- 微信登录弹窗 --> <style> .popupBg .n-error{ color: red; } </style> <div class="popupBg"> <div class="loginBoxBox"> <div class="imgbg"> <img src="/assets/images/leftlogo.jpg" alt=""> </div> <!-- 微信登录 --> <div class="loginInfo encodeLogin" style="display: none;"> <div class="closeIcon" onclick="$('.popupBg').hide();"></div> <div class="changeLoginType cursorPointer create_wxqrcode" onclick="$('.loginInfo').hide();$('.passwordLogin').show();"> <div class="tip">密码登录在这里</div> </div> <div class="encodeInfo"> <div class="tit"><i></i> 微信扫码登录或注册</div> <div class="encodeImg"> <span id="wx_login_qrcode"><img src="/assets/examples/code.png" alt="二维码"></span> <!-- <div class="refreshBox"> <p>二维码失效</p> <button type="button" class="create_wxqrcode">刷新1111</button> </div> --> </div> <div class="tip">打开微信扫一扫,快速登录/注册</div> </div> <div class="beforeLoginTip">登录即同意 <a href="#" class="aBlue" title="用户协议">用户协议</a> 和 <a href="#" class="aBlue" title="隐私政策">隐私政策</a></div> </div> <!-- 密码登录 --> <div class="loginInfo passwordLogin"> <div class="closeIcon" onclick="$('.popupBg').hide();"></div> <div class="changeLoginType cursorPointer create_wxqrcode" onclick="$('.loginInfo').hide();$('.encodeLogin').show();"> <div class="tip">微信登录更方便</div> </div> <div class="passwordInfo"> <ul class="logintabs selfTabMenu"> <li class="selfTabItem loginFormLi curr">密码登录</li> <li class="selfTabItem registerFormBox ">注册账号</li> </ul> <div class="selfTabContBox"> <div class="selfTabCont loginFormBox" style="display: block;"> <form name="form" id="login-form" class="form-vertical form" method="POST" action="/index/user/login"> <input type="hidden" name="url" value="//www.17golang.com/article/358965.html"/> <input type="hidden" name="__token__" value="cd3c8fc727b097cfd1045dbb5fc3e7e7" /> <div class="form-group" style="height:70px;"> <input class="form-control" id="account" type="text" name="account" value="" data-rule="required" placeholder="邮箱/用户名" autocomplete="off"> </div> <div class="form-group" style="height:70px;"> <input class="form-control" id="password" type="password" name="password" data-rule="required;password" placeholder="密码" autocomplete="off"> </div> <div class="codeBox" style="height:70px;"> <div class="form-group" style="height:70px; width:205px; float: left;"> <input type="text" name="captcha" class="form-control" placeholder="验证码" data-rule="required;length(4)" /> </div> <span class="input-group-btn" style="padding:0;border:none;"> <img src="/captcha.html" width="100" height="45" onclick="this.src = '/captcha.html?r=' + Math.random();"/> </span> </div> <div class="other"> <a href="#" class="forgetPwd aGray" onclick="$('.loginInfo').hide();$('.passwordForget').show();" title="忘记密码">忘记密码</a> </div> <div class="loginBtn mt25"> <button type="submit">登录</button> </div> </form> </div> <div class="selfTabCont registerFormBox" style="display: none;"> <form name="form1" id="register-form" class="form-vertical form" method="POST" action="/index/user/register"> <input type="hidden" name="invite_user_id" value="0"/> <input type="hidden" name="url" value="//www.17golang.com/article/358965.html"/> <input type="hidden" name="__token__" value="cd3c8fc727b097cfd1045dbb5fc3e7e7" /> <div class="form-group" style="height:70px;"> <input type="text" name="email" id="email2" data-rule="required;email" class="form-control" placeholder="邮箱"> </div> <div class="form-group" style="height:70px;"> <input type="text" id="username" name="username" data-rule="required;username" class="form-control" placeholder="用户名必须3-30个字符"> </div> <div class="form-group" style="height:70px;"> <input type="password" id="password2" name="password" data-rule="required;password" class="form-control" placeholder="密码必须6-30个字符"> </div> <div class="codeBox" style="height:70px;"> <div class="form-group" style="height:70px; width:205px; float: left;"> <input type="text" name="captcha" class="form-control" placeholder="验证码" data-rule="required;length(4)" /> </div> <span class="input-group-btn" style="padding:0;border:none;"> <img src="/captcha.html" width="100" height="45" onclick="this.src = '/captcha.html?r=' + Math.random();"/> </span> </div> <div class="loginBtn"> <button type="submit">注册</button> </div> </form> </div> </div> </div> <div class="beforeLoginTip">登录即同意 <a href="https://www.17golang.com/about/3.html" target="_blank" class="aBlue" title="用户协议">用户协议</a> 和 <a href="https://www.17golang.com/about/4.html" target="_blank" class="aBlue" title="隐私政策">隐私政策</a></div> </div> <!-- 重置密码 --> <div class="loginInfo passwordForget"> <div class="closeIcon" onclick="$('.popupBg').hide();"></div> <div class="returnLogin cursorPointer" onclick="$('.passwordForget').hide();$('.passwordLogin').show();">返回登录</div> <div class="passwordInfo"> <ul class="logintabs selfTabMenu"> <li class="selfTabItem">重置密码</li> </ul> <div class="selfTabContBox"> <div class="selfTabCont"> <form id="resetpwd-form" class="form-horizontal form-layer nice-validator n-default n-bootstrap form" method="POST" action="/api/user/resetpwd.html" novalidate="novalidate"> <div style="height:70px;"> <input type="text" class="form-control" id="email" name="email" value="" placeholder="输入邮箱" aria-invalid="true"> </div> <div class="codeBox" style="height:70px;"> <div class="form-group" style="height:70px; width:205px; float: left;"> <input type="text" name="captcha" class="form-control" placeholder="验证码" /> </div> <span class="input-group-btn" style="padding:0;border:none;"> <a href="javascript:;" class="btn btn-primary btn-captcha cursorPointer" style="background: #2080F8; border-radius: 4px; color: #fff; padding: 12px; position: absolute;" data-url="/api/ems/send.html" data-type="email" data-event="resetpwd">发送验证码</a> </span> </div> <input type="password" class="form-control" id="newpassword" name="newpassword" value="" placeholder="请输入6-18位密码"> <div class="loginBtn mt25"> <button type="submit">重置密码</button> </div> </form> </div> </div> </div> </div> </div> </div> <script src="/assets/js/juejin-theme.js?v=20260613b" defer></script> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?e34c3e8ab31ba35d7e1c48ea8d77315f"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <script src="/assets/js/frontend/common.js"></script> </body> </html>