JQuery解析HTML、JSON和XML实例详解

JQuery解析HTML、JSON和XML实例详解

1. HTML解析

1.1. 使用.text()方法解析HTML

1.1.1. 代码示例

<!-- HTML文本 -->
<div id="content">
  <p>Hello, World!</p>
</div>
// JQuery代码
var htmlText = $('#content').text();

1.1.2. 解析结果

Hello, World!

1.1.3. 解析过程

使用JQuery中的.text()方法,可以获取指定元素的所有文本内容,包括所有的标签和属性,返回一个字符串。在上面的示例中,我们使用JQuery选择器获取了id为content的

元素,在调用.text()方法后返回了该元素中

标签中的文本"Hello, World!"。

1.2. 使用.html()方法解析HTML

1.2.1. 代码示例

<!-- HTML文本 -->
<div id="content">
  <p>Hello, <strong>World!</strong></p>
</div>
// JQuery代码
var htmlText = $('#content').html();

1.2.2. 解析结果

<p>Hello, <strong>World!</strong></p>

1.2.3. 解析过程

与.text()方法类似,使用JQuery中的.html()方法也可以获取指定元素的文本内容,但有所不同的是,它能够获取并返回该元素中所有的HTML标签和属性。在上面的示例中,我们使用JQuery选择器获取了id为content的

元素,在调用.html()方法后返回了整个

标签中的HTML代码,包含了其中的标签。

2. JSON解析

2.1. 解析简单的JSON数据

2.1.1. 代码示例

// JSON对象
{
  "name": "Tom",
  "age": 22,
  "birthday": "1999-01-01"
}
// JQuery代码
var jsonData = '{ "name": "Tom", "age": 22, "birthday": "1999-01-01" }';
var json = $.parseJSON(jsonData);

2.1.2. 解析结果

{
  "name": "Tom",
  "age": 22,
  "birthday": "1999-01-01"
}

2.1.3. 解析过程

使用JQuery中的$.parseJSON()方法,可以将JSON格式的字符串转换为JSON对象。在上面的示例中,我们定义了一个JSON格式的字符串,并将其传给$.parseJSON()方法,然后将返回的JSON对象存入变量json中,最终得到一个包含三个属性(name、age、birthday)的JSON对象。

2.2. 解析复杂的JSON数据

2.2.1. 代码示例

// JSON对象
{
  "name": "Tom",
  "age": 22,
  "contact": {
    "email": "tom@example.com",
    "phone": "123-456-7890"
  },
  "hobbies": [
    "reading",
    "travel"
  ]
}
// JQuery代码
var jsonData = '{ "name": "Tom", "age": 22, "contact": { "email": "tom@example.com", "phone": "123-456-7890" }, "hobbies": ["reading", "travel"] }';
var json = $.parseJSON(jsonData);

2.2.2. 解析结果

{
  "name": "Tom",
  "age": 22,
  "contact": {
    "email": "tom@example.com",
    "phone": "123-456-7890"
  },
  "hobbies": [
    "reading",
    "travel"
  ]
}

2.2.3. 解析过程

使用$.parseJSON()方法解析复杂的JSON数据时,需要确保JSON数据的格式符合JSON规范。在上面的示例中,我们定义了一个包含多个属性,其中contact属性是一个嵌套的JSON对象,hobbies属性是一个由多个字符串元素组成的JSON数组。将JSON格式的字符串传给$.parseJSON()方法后,它返回一个对应的JSON对象。

3. XML解析

3.1. 解析简单的XML数据

3.1.1. 代码示例

<!-- XML文本 -->
<bookstore>
  <book category="web">
    <title lang="en">Everyday JavaScript</title>
    <author>John Doe</author>
    <year>2019</year>
    <price>19.99</price>
  </book>
</bookstore>
// JQuery代码
var xml = $.parseXML(xmlText);
var $xml = $(xml);
var bookTitle = $xml.find('title').text();

3.1.2. 解析结果

Everyday JavaScript

3.1.3. 解析过程

使用JQuery中的$.parseXML()方法,可以将XML格式的字符串转换为XML文档对象。然后使用$(xml)将XML文档对象封装成JQuery对象,最后可以使用JQuery选择器获取XML文档中的元素。在上面的示例中,我们获取了XML文档中的元素,并使用.text()方法获取其中的文本内容。</p> <h3>3.2. 解析复杂的XML数据</h3> <h4>3.2.1. 代码示例</h4> <pre><code class="language-xml"><!-- XML文本 --> <library> <book> <title>Everyday JavaScript</title> <authors> <author>John Doe</author> <author>Jane Doe</author> </authors> <price>19.99</price> </book> <book> <title>JavaScript Development Patterns</title> <authors> <author>Stoyan Stefanov</author> </authors> <price>29.99</price> </book> </library> </code></pre> <pre><code class="language-javascript">// JQuery代码 var xml = $.parseXML(xmlText); var $xml = $(xml); var books = []; $xml.find('book').each(function() { var bookTitle = $(this).find('title').text(); var authors = []; $(this).find('author').each(function() { authors.push($(this).text()); }); var price = $(this).find('price').text(); var book = { 'title': bookTitle, 'authors': authors, 'price': price }; books.push(book); }); </code></pre> <h4>3.2.2. 解析结果</h4> <pre><code class="language-javascript">[ { "title": "Everyday JavaScript", "authors": [ "John Doe", "Jane Doe" ], "price": "19.99" }, { "title": "JavaScript Development Patterns", "authors": [ "Stoyan Stefanov" ], "price": "29.99" } ] </code></pre> <h4>3.2.3. 解析过程</h4> <p>在解析复杂的XML数据时,需要根据XML文档的结构,选择合适的方法来获取、解析相应的元素。在上面的示例中,我们使用$.parseXML()方法将XML格式的字符串转换为XML文档对象,并使用$(xml)将其封装成JQuery对象。然后,我们使用JQuery选择器获取XML文档中的所有<book>元素,使用.each()方法遍历每个<book>元素,使用.find()方法获取其中的<titles>、<authors>、<price>元素,最后将这些元素的内容组成一个JSON格式的对象,存入一个数组中。最终得到了一个包含多个图书信息的JSON数据。</p> <div class="entry-readmore"><div class="entry-readmore-btn"></div></div> <div class="entry-copyright"><p>本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:<a href="https://pythonjishu.com/ywonfrqlwkjagfq/">JQuery解析HTML、JSON和XML实例详解 - Python技术站</a></p></div> </div> <div class="entry-tag"><a href="https://pythonjishu.com/tag/javascript/" rel="tag">javascript</a></div> <div class="entry-action"> <div class="btn-zan" data-id="251576"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-thumb-up-fill"></use></svg></i> 赞 <span class="entry-action-num">(0)</span></div> </div> <div class="entry-bar"> <div class="entry-bar-inner"> <div class="entry-bar-info entry-bar-info2"> <div class="info-item meta"> <a class="meta-item j-heart" href="javascript:;" data-id="251576"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-star"></use></svg></i> <span class="data">0</span></a> <a class="meta-item" href="#comments"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-comment"></use></svg></i> <span class="data">0</span></a> <a class="meta-item dashang" href="javascript:;"> <i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-cny-circle-fill"></use></svg></i> 打赏 <span class="dashang-img dashang-img2"> <span> <img src="//pythonjishu.com/wp-content/uploads/2023/02/2023-02-06_10-34-29.jpg" alt="微信扫一扫"/> 微信扫一扫 </span> <span> <img src="//pythonjishu.com/wp-content/uploads/2023/02/2023-02-06_10-35-01.jpg" alt="支付宝扫一扫"/> 支付宝扫一扫 </span> </span> </a> </div> <div class="info-item share"> <a class="meta-item mobile j-mobile-share" href="javascript:;" data-id="251576" data-qrcode="https://pythonjishu.com/ywonfrqlwkjagfq/"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-share"></use></svg></i> 生成海报</a> <a class="meta-item wechat" data-share="wechat" target="_blank" rel="nofollow" href="#"> <i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-wechat"></use></svg></i> </a> <a class="meta-item weibo" data-share="weibo" target="_blank" rel="nofollow" href="#"> <i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-weibo"></use></svg></i> </a> <a class="meta-item qq" data-share="qq" target="_blank" rel="nofollow" href="#"> <i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-qq"></use></svg></i> </a> <a class="meta-item qzone" data-share="qzone" target="_blank" rel="nofollow" href="#"> <i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-qzone"></use></svg></i> </a> </div> <div class="info-item act"> <a href="javascript:;" id="j-reading"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-article"></use></svg></i></a> </div> </div> </div> </div> </div> <div class="entry-page"> <div class="entry-page-prev entry-page-nobg"> <a href="https://pythonjishu.com/kvojuxmsoqnfxyf/" title="JavaScript学习笔记之函数记忆" rel="prev"> <span>JavaScript学习笔记之函数记忆</span> </a> <div class="entry-page-info"> <span class="pull-left"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-arrow-left-double"></use></svg></i> 上一篇</span> <span class="pull-right">2023年5月27日</span> </div> </div> <div class="entry-page-next entry-page-nobg"> <a href="https://pythonjishu.com/bemnryoehbacupx/" title="JavaScript中eval()函数用法详解" rel="next"> <span>JavaScript中eval()函数用法详解</span> </a> <div class="entry-page-info"> <span class="pull-right">下一篇 <i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-arrow-right-double"></use></svg></i></span> <span class="pull-left">2023年5月27日</span> </div> </div> </div> <div class="entry-related-posts"> <h3 class="entry-related-title">相关文章</h3><ul class="entry-related cols-3 post-loop post-loop-default"><li class="item item-no-thumb"> <div class="item-content"> <h3 class="item-title"> <a href="https://pythonjishu.com/ugkksmwfukdmwpb/" rel="bookmark"> 原生JS中应该禁止出现的写法 </a> </h3> <div class="item-excerpt"> <p>当使用原生JavaScript编写代码时,需要注意一些写法上的问题,避免引发不必要的错误或者性能问题。以下是几个应该禁止出现的写法。 1. 使用 document.write document.write 是一种在网页中输出HTML的方法,但是它的使用会破坏页面的结构,降低性能,还可能引起安全问题。当使用 document.write 时,浏览器会强制停止所…</p> </div> <div class="item-meta"> <a class="item-meta-li" href="https://pythonjishu.com/other/javascript/" target="_blank">JavaScript</a> <span class="item-meta-li date">2023年6月10日</span> <div class="item-meta-right"> <a class="item-meta-li comments" href="https://pythonjishu.com/ugkksmwfukdmwpb/#comments" target="_blank" title="评论数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-comment"></use></svg></i>0</a><span class="item-meta-li stars" title="收藏数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-star"></use></svg></i>0</span><span class="item-meta-li likes" title="点赞数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-thumb-up"></use></svg></i>0</span> </div> </div> </div> </li> <li class="item item-no-thumb"> <div class="item-content"> <h3 class="item-title"> <a href="https://pythonjishu.com/xibijrvnvcklrot/" rel="bookmark"> 获取客户端电脑日期时间js代码(jquery) </a> </h3> <div class="item-excerpt"> <p>获取客户端电脑日期时间的js代码可以通过javascript的内置Date对象或者第三方库jquery来实现。下面我将详细介绍两种获取客户端电脑日期时间的js代码。 使用Date对象获取电脑日期时间 javascript内置Date对象提供了获取电脑日期时间的方法。可以通过以下代码实现: var now = new Date(); var year = no…</p> </div> <div class="item-meta"> <a class="item-meta-li" href="https://pythonjishu.com/other/javascript/" target="_blank">JavaScript</a> <span class="item-meta-li date">2023年5月27日</span> <div class="item-meta-right"> <a class="item-meta-li comments" href="https://pythonjishu.com/xibijrvnvcklrot/#comments" target="_blank" title="评论数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-comment"></use></svg></i>0</a><span class="item-meta-li stars" title="收藏数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-star"></use></svg></i>0</span><span class="item-meta-li likes" title="点赞数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-thumb-up"></use></svg></i>0</span> </div> </div> </div> </li> <li class="item item-no-thumb"> <div class="item-content"> <h3 class="item-title"> <a href="https://pythonjishu.com/usyiyefoliguxcl/" rel="bookmark"> 详解JavaScript对数组操作(添加/删除/截取/排序/倒序) </a> </h3> <div class="item-excerpt"> <p>下面我将详细讲解JavaScript对数组的各种操作方法。 数组的定义 JavaScript中的数组可以包含任意数量的元素,并且可以存储不同类型的数据,如数字、字符串和对象等。在JavaScript中,可以通过以下方式来定义一个数组: // 定义一个数字类型的数组 var nums = [1, 2, 3, 4, 5]; // 定义一个字符串类型的数组 var…</p> </div> <div class="item-meta"> <a class="item-meta-li" href="https://pythonjishu.com/other/javascript/" target="_blank">JavaScript</a> <span class="item-meta-li date">2023年5月27日</span> <div class="item-meta-right"> <a class="item-meta-li comments" href="https://pythonjishu.com/usyiyefoliguxcl/#comments" target="_blank" title="评论数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-comment"></use></svg></i>0</a><span class="item-meta-li stars" title="收藏数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-star"></use></svg></i>0</span><span class="item-meta-li likes" title="点赞数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-thumb-up"></use></svg></i>0</span> </div> </div> </div> </li> <li class="item item-no-thumb"> <div class="item-content"> <h3 class="item-title"> <a href="https://pythonjishu.com/uzuzgameeoawzro/" rel="bookmark"> JS闭包的几种常见形式实例详解 </a> </h3> <div class="item-excerpt"> <p>JS闭包的几种常见形式实例详解 什么是闭包? 在理解闭包的几种形式之前,我们先来了解一下什么是闭包。 闭包指的是一个函数在返回时,能够记住并访问该函数定义时作用域中的变量。这可以通过在函数内部定义一个函数来实现。 闭包发挥着非常重要的作用,因为它可以在函数外部访问函数内部的变量和函数,并且使得这些变量和函数的作用域得以保存。 闭包的几种常见形式 1. 函数作…</p> </div> <div class="item-meta"> <a class="item-meta-li" href="https://pythonjishu.com/other/javascript/" target="_blank">JavaScript</a> <span class="item-meta-li date">2023年6月10日</span> <div class="item-meta-right"> <a class="item-meta-li comments" href="https://pythonjishu.com/uzuzgameeoawzro/#comments" target="_blank" title="评论数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-comment"></use></svg></i>0</a><span class="item-meta-li stars" title="收藏数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-star"></use></svg></i>0</span><span class="item-meta-li likes" title="点赞数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-thumb-up"></use></svg></i>0</span> </div> </div> </div> </li> <li class="item item-no-thumb"> <div class="item-content"> <h3 class="item-title"> <a href="https://pythonjishu.com/xtvssjporocqcys/" rel="bookmark"> js电话号码验证方法 </a> </h3> <div class="item-excerpt"> <p>请跟我一起学习“js电话号码验证方法”的完整攻略。 一、需求分析 如果你在网站或应用中需要让用户输入手机号码,那么你就需要对输入的电话号码进行验证。电话号码的规则不同于其他类型的输入,因此需要特殊的验证方法。我们希望可以检验用户输入的电话号码是否符合规范,且可以在用户输入的时候实时进行验证。 二、实现方法 下面是一个简单的js电话号码验证方法 functio…</p> </div> <div class="item-meta"> <a class="item-meta-li" href="https://pythonjishu.com/other/javascript/" target="_blank">JavaScript</a> <span class="item-meta-li date">2023年6月10日</span> <div class="item-meta-right"> <a class="item-meta-li comments" href="https://pythonjishu.com/xtvssjporocqcys/#comments" target="_blank" title="评论数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-comment"></use></svg></i>0</a><span class="item-meta-li stars" title="收藏数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-star"></use></svg></i>0</span><span class="item-meta-li likes" title="点赞数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-thumb-up"></use></svg></i>0</span> </div> </div> </div> </li> <li class="item item-no-thumb"> <div class="item-content"> <h3 class="item-title"> <a href="https://pythonjishu.com/plbrsxhnxeneowz/" rel="bookmark"> Javascript中arguments对象的详解与使用方法 </a> </h3> <div class="item-excerpt"> <p>Javascript中arguments对象的详解与使用方法 什么是arguments对象 arguments是一个函数的内置对象,它表示函数在调用时传入的所有参数,即使函数在定义时没有声明任何参数也可以使用。该对象会在每次函数调用时自动创建。 举个例子: function foo() { console.log(arguments); } foo(1, ‘…</p> </div> <div class="item-meta"> <a class="item-meta-li" href="https://pythonjishu.com/other/javascript/" target="_blank">JavaScript</a> <span class="item-meta-li date">2023年5月27日</span> <div class="item-meta-right"> <a class="item-meta-li comments" href="https://pythonjishu.com/plbrsxhnxeneowz/#comments" target="_blank" title="评论数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-comment"></use></svg></i>0</a><span class="item-meta-li stars" title="收藏数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-star"></use></svg></i>0</span><span class="item-meta-li likes" title="点赞数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-thumb-up"></use></svg></i>0</span> </div> </div> </div> </li> <li class="item item-no-thumb"> <div class="item-content"> <h3 class="item-title"> <a href="https://pythonjishu.com/mfhrtixktqaavmr/" rel="bookmark"> js split函数用法总结(从入门到精通) </a> </h3> <div class="item-excerpt"> <p>JS split函数用法总结(从入门到精通) 什么是split函数 split()函数是JavaScript中字符串对象的一个方法,用于将一个字符串根据指定的分隔符分割成一个由多个子字符串组成的数组。 split函数的基本语法 stringObject.split(separator, limit) 参数说明: separator:必需。一个字符串或正则表达…</p> </div> <div class="item-meta"> <a class="item-meta-li" href="https://pythonjishu.com/other/javascript/" target="_blank">JavaScript</a> <span class="item-meta-li date">2023年5月27日</span> <div class="item-meta-right"> <a class="item-meta-li comments" href="https://pythonjishu.com/mfhrtixktqaavmr/#comments" target="_blank" title="评论数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-comment"></use></svg></i>0</a><span class="item-meta-li stars" title="收藏数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-star"></use></svg></i>0</span><span class="item-meta-li likes" title="点赞数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-thumb-up"></use></svg></i>0</span> </div> </div> </div> </li> <li class="item item-myimg"><div class="wpcom_myimg_wrap __flow"><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2252152819722406" crossorigin="anonymous"></script> <!-- 通用 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-2252152819722406" data-ad-slot="5528197265" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script></div></li><li class="item item-no-thumb"> <div class="item-content"> <h3 class="item-title"> <a href="https://pythonjishu.com/wiyjgzkkazedjze/" rel="bookmark"> js取滚动条的尺寸的函数代码 </a> </h3> <div class="item-excerpt"> <p>JavaScript取得滚动条的尺寸通常需要创建一个函数,以下为具体的实现方式: 创建获取滚动条尺寸的函数 function getScrollWidth() { var div = document.createElement(‘div’); // 设置样式,避免在计算尺寸时产生影响 div.style.width = ‘100px’; div.style…</p> </div> <div class="item-meta"> <a class="item-meta-li" href="https://pythonjishu.com/other/javascript/" target="_blank">JavaScript</a> <span class="item-meta-li date">2023年6月11日</span> <div class="item-meta-right"> <a class="item-meta-li comments" href="https://pythonjishu.com/wiyjgzkkazedjze/#comments" target="_blank" title="评论数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-comment"></use></svg></i>0</a><span class="item-meta-li stars" title="收藏数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-star"></use></svg></i>0</span><span class="item-meta-li likes" title="点赞数"><i class="wpcom-icon wi"><svg aria-hidden="true"><use xlink:href="#wi-thumb-up"></use></svg></i>0</span> </div> </div> </div> </li> </ul> </div> </article> </main> <aside class="sidebar"> <div class="widget widget_post_thumb"><h3 class="widget-title"><span>最新文章</span></h3> <ul> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="https://pythonjishu.com/openai-sora/" title="OpenAI重磅发布首个视频生成模型Sora,网友:一出手就是王炸!"> <img width="480" height="300" src="https://pythonjishu.com/wp-content/themes/justnews/themer/assets/images/lazy.png" class="attachment-default size-default wp-post-image j-lazy" alt="OpenAI重磅发布首个视频生成模型Sora,网友:一出手就是王炸!" decoding="async" data-original="https://pythonjishu.com/wp-content/uploads/2024/02/66372-20240216111025772-344088444-480x300.gif" /> </a> </div> <div class="item-content"> <p class="item-title"><a href="https://pythonjishu.com/openai-sora/" title="OpenAI重磅发布首个视频生成模型Sora,网友:一出手就是王炸!">OpenAI重磅发布首个视频生成模型Sora,网友:一出手就是王炸!</a></p> <p class="item-date">2024年2月17日</p> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="https://pythonjishu.com/openai-developer-conference/" title="短短 45 分钟发布会,OpenAI 再次让 AI 圈一夜未眠!"> <img width="480" height="300" src="https://pythonjishu.com/wp-content/themes/justnews/themer/assets/images/lazy.png" class="attachment-default size-default wp-post-image j-lazy" alt="短短 45 分钟发布会,OpenAI 再次让 AI 圈一夜未眠!" decoding="async" data-original="https://pythonjishu.com/wp-content/uploads/2023/11/6ee575e7369b-480x300.jpg" /> </a> </div> <div class="item-content"> <p class="item-title"><a href="https://pythonjishu.com/openai-developer-conference/" title="短短 45 分钟发布会,OpenAI 再次让 AI 圈一夜未眠!">短短 45 分钟发布会,OpenAI 再次让 AI 圈一夜未眠!</a></p> <p class="item-date">2023年11月8日</p> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="https://pythonjishu.com/ai-create-article-3/" title="如何评估AI 文章的输出质量:深入了解人工智慧生成的内容"> <img width="480" height="300" src="https://pythonjishu.com/wp-content/themes/justnews/themer/assets/images/lazy.png" class="attachment-default size-default wp-post-image j-lazy" alt="如何评估AI 文章的输出质量:深入了解人工智慧生成的内容" decoding="async" data-original="https://pythonjishu.com/wp-content/uploads/2023/10/photo-1684369175833-4b445ad6bfb5-480x300.jpg" /> </a> </div> <div class="item-content"> <p class="item-title"><a href="https://pythonjishu.com/ai-create-article-3/" title="如何评估AI 文章的输出质量:深入了解人工智慧生成的内容">如何评估AI 文章的输出质量:深入了解人工智慧生成的内容</a></p> <p class="item-date">2023年11月1日</p> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="https://pythonjishu.com/ai-create-article-2/" title="根据目标受众调整AI 写作风格:有效运用人工智能技术撰写吸引读者的内容"> <img width="480" height="300" src="https://pythonjishu.com/wp-content/themes/justnews/themer/assets/images/lazy.png" class="attachment-default size-default wp-post-image j-lazy" alt="根据目标受众调整AI 写作风格:有效运用人工智能技术撰写吸引读者的内容" decoding="async" data-original="https://pythonjishu.com/wp-content/uploads/2023/10/photo-1686191128680-caa7558da57f-480x300.jpg" /> </a> </div> <div class="item-content"> <p class="item-title"><a href="https://pythonjishu.com/ai-create-article-2/" title="根据目标受众调整AI 写作风格:有效运用人工智能技术撰写吸引读者的内容">根据目标受众调整AI 写作风格:有效运用人工智能技术撰写吸引读者的内容</a></p> <p class="item-date">2023年10月29日</p> </div> </li> <li class="item"> <div class="item-img"> <a class="item-img-inner" href="https://pythonjishu.com/ai-create-article/" title="5款中文AI文章产生器:中文写作必备「AI写作工具」快速SEO文章"> <img width="480" height="300" src="https://pythonjishu.com/wp-content/themes/justnews/themer/assets/images/lazy.png" class="attachment-default size-default wp-post-image j-lazy" alt="5款中文AI文章产生器:中文写作必备「AI写作工具」快速SEO文章" decoding="async" data-original="https://pythonjishu.com/wp-content/uploads/2023/10/photo-1686191567765-480x300.jpg" /> </a> </div> <div class="item-content"> <p class="item-title"><a href="https://pythonjishu.com/ai-create-article/" title="5款中文AI文章产生器:中文写作必备「AI写作工具」快速SEO文章">5款中文AI文章产生器:中文写作必备「AI写作工具」快速SEO文章</a></p> <p class="item-date">2023年10月29日</p> </div> </li> </ul> </div><div class="widget widget_html_myimg"><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2252152819722406" crossorigin="anonymous"></script> <!-- 通用 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-2252152819722406" data-ad-slot="5528197265" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script></div><div class="widget widget_lastest_news"><h3 class="widget-title"><span>热门文章</span></h3></div> </aside> </div> </div> <footer class="footer"> <div class="container"> <div class="footer-col-wrap footer-with-icon"> <div class="footer-col footer-col-copy"> <ul class="footer-nav hidden-xs"><li id="menu-item-374373" class="menu-item menu-item-374373"><a href="https://pythonjishu.com/about/">关于我们</a></li> <li id="menu-item-374372" class="menu-item menu-item-privacy-policy menu-item-374372"><a rel="privacy-policy" href="https://pythonjishu.com/privacy-policy/">隐私政策</a></li> </ul> <div class="copyright"> <div class="copyright"> <p style="text-align: left;">© 2022-2024 <strong><a href="https://pythonjishu.com/" target="_blank" rel="noopener">Python技术站</a> </strong> 保留所有权利</p> <p style="text-align: left;"><img class="" src="https://pythonjishu.com/wp-content/uploads/2023/11/baico.png" alt="baico" width="16" height="18" /> <a href="https://beian.mps.gov.cn/#/query/webSearch?code=21010502000733" target="_blank" rel="nofollow noopener noreferrer">辽公网安备21010502000733号</a> <a href="https://beian.miit.gov.cn" target="_blank" rel="nofollow noopener noreferrer">辽ICP备18014290号</a></p> <p><img class="alignleft" src="https://pythonjishu.com/wp-content/uploads/2023/11/aliprotected.png" alt="aliprotected" width="244" height="26" /></p> </div> </div> </div> <div class="footer-col footer-col-sns"> <div class="footer-sns"> <a class="sns-wx" href="javascript:;" aria-label="icon"> <i class="wpcom-icon fa fa-wechat sns-icon"></i> <span style="background-image:url('//pythonjishu.com/wp-content/uploads/2023/01/wechat-metahuber.jpg');"></span> </a> <a class="sns-wx" href="javascript:;" aria-label="icon"> <i class="wpcom-icon ri-music-fill sns-icon"></i> <span style="background-image:url('//pythonjishu.com/wp-content/uploads/2023/05/2023-05-07_20-49-41.jpg');"></span> </a> </div> </div> </div> </div> </footer> <div class="action action-style-1 action-color-1 action-pos-1" style="bottom:320px;"> <div class="action-item"> <i class="wpcom-icon fa fa-wechat action-item-icon"></i> <span>合作推广</span> <div class="action-item-inner action-item-type-1"> <img class="action-item-img" src="//pythonjishu.com/wp-content/uploads/2023/01/wechat-metahuber.jpg" alt="合作推广"> </div> </div> <div class="action-item j-share"> <i class="wpcom-icon wi action-item-icon"><svg aria-hidden="true"><use xlink:href="#wi-share"></use></svg></i> <span>分享本页</span> </div> <div class="action-item gotop j-top"> <i class="wpcom-icon wi action-item-icon"><svg aria-hidden="true"><use xlink:href="#wi-arrow-up-2"></use></svg></i> <span>返回顶部</span> </div> </div> <script type="text/javascript" id="main-js-extra"> /* <![CDATA[ */ var _wpcom_js = {"webp":"","ajaxurl":"https:\/\/pythonjishu.com\/wp-admin\/admin-ajax.php","theme_url":"https:\/\/pythonjishu.com\/wp-content\/themes\/justnews","slide_speed":"5000","is_admin":"0","lang":"zh_CN","js_lang":{"share_to":"\u5206\u4eab\u5230:","copy_done":"\u590d\u5236\u6210\u529f\uff01","copy_fail":"\u6d4f\u89c8\u5668\u6682\u4e0d\u652f\u6301\u62f7\u8d1d\u529f\u80fd","confirm":"\u786e\u5b9a","qrcode":"\u4e8c\u7ef4\u7801","page_loaded":"\u5df2\u7ecf\u5230\u5e95\u4e86","no_content":"\u6682\u65e0\u5185\u5bb9","load_failed":"\u52a0\u8f7d\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5\uff01","expand_more":"\u9605\u8bfb\u5269\u4f59 %s"},"share":"1","lightbox":"1","post_id":"251576","user_card_height":"356","poster":{"notice":"\u8bf7\u300c\u70b9\u51fb\u4e0b\u8f7d\u300d\u6216\u300c\u957f\u6309\u4fdd\u5b58\u56fe\u7247\u300d\u540e\u5206\u4eab\u7ed9\u66f4\u591a\u597d\u53cb","generating":"\u6b63\u5728\u751f\u6210\u6d77\u62a5\u56fe\u7247...","failed":"\u6d77\u62a5\u56fe\u7247\u751f\u6210\u5931\u8d25"},"video_height":"484","fixed_sidebar":"1","dark_style":"0","font_url":"\/\/fonts.googleapis.com\/css2?family=Noto+Sans+SC:wght@400;500&display=swap","follow_btn":"<i class=\"wpcom-icon wi\"><svg aria-hidden=\"true\"><use xlink:href=\"#wi-add\"><\/use><\/svg><\/i>\u5173\u6ce8","followed_btn":"\u5df2\u5173\u6ce8","user_card":"1"}; /* ]]> */ </script> <script type="text/javascript" src="https://pythonjishu.com/wp-content/themes/justnews/js/main.js?ver=6.19.0" id="main-js"></script> <script type="text/javascript" src="https://pythonjishu.com/wp-content/themes/justnews/themer/assets/js/icons-2.7.19.js?ver=6.19.0" id="wpcom-icons-js"></script> <script type="text/javascript" id="wpcom-member-js-extra"> /* <![CDATA[ */ var _wpmx_js = {"ajaxurl":"https:\/\/pythonjishu.com\/wp-admin\/admin-ajax.php","plugin_url":"https:\/\/pythonjishu.com\/wp-content\/plugins\/wpcom-member\/","post_id":"251576","js_lang":{"login_desc":"\u60a8\u8fd8\u672a\u767b\u5f55\uff0c\u8bf7\u767b\u5f55\u540e\u518d\u8fdb\u884c\u76f8\u5173\u64cd\u4f5c\uff01","login_title":"\u8bf7\u767b\u5f55","login_btn":"\u767b\u5f55","reg_btn":"\u6ce8\u518c"},"login_url":"https:\/\/pythonjishu.com\/%e7%94%a8%e6%88%b7%e7%99%bb%e5%bd%95\/?modal-type=login","register_url":"https:\/\/pythonjishu.com\/%e7%94%a8%e6%88%b7%e6%b3%a8%e5%86%8c\/?modal-type=register","errors":{"require":"\u4e0d\u80fd\u4e3a\u7a7a","email":"\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u7535\u5b50\u90ae\u7bb1","pls_enter":"\u8bf7\u8f93\u5165","password":"\u5bc6\u7801\u5fc5\u987b\u4e3a6~32\u4e2a\u5b57\u7b26","passcheck":"\u4e24\u6b21\u5bc6\u7801\u8f93\u5165\u4e0d\u4e00\u81f4","phone":"\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u624b\u673a\u53f7\u7801","terms":"\u8bf7\u9605\u8bfb\u5e76\u540c\u610f\u6761\u6b3e","sms_code":"\u9a8c\u8bc1\u7801\u9519\u8bef","captcha_verify":"\u8bf7\u70b9\u51fb\u6309\u94ae\u8fdb\u884c\u9a8c\u8bc1","captcha_fail":"\u4eba\u673a\u9a8c\u8bc1\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5","nonce":"\u968f\u673a\u6570\u6821\u9a8c\u5931\u8d25","req_error":"\u8bf7\u6c42\u5931\u8d25"}}; /* ]]> */ </script> <script type="text/javascript" src="https://pythonjishu.com/wp-content/plugins/wpcom-member/js/index.js?ver=1.5.2.1" id="wpcom-member-js"></script> <script type="text/javascript" src="https://pythonjishu.com/wp-content/themes/justnews/js/wp-embed.js?ver=6.19.0" id="wp-embed-js"></script> <script id="module-flowchart"> (function($) { $(function() { if (typeof $.fn.flowChart !== "undefined") { if ($(".language-flow").length > 0) { $(".language-flow").parent("pre").attr("style", "text-align: center; background: none;"); $(".language-flow").addClass("flowchart").removeClass("language-flow"); $(".flowchart").flowChart(); } } }); })(jQuery); </script> <script id="module-sequence-diagram"> (function($) { $(function() { if (typeof $.fn.sequenceDiagram !== "undefined") { $(".language-sequence").parent("pre").attr("style", "text-align: center; background: none;"); $(".language-seq").parent("pre").attr("style", "text-align: center; background: none;"); $(".language-sequence").addClass("sequence-diagram").removeClass("language-sequence"); $(".language-seq").addClass("sequence-diagram").removeClass("language-seq"); $(".sequence-diagram").sequenceDiagram({ theme: "simple" }); } }); })(jQuery); </script> <script id="module-toc"> (function($) { $(function() { }); })(jQuery); </script> <script>document.getElementById('j-user-wrap').style.display="none";</script> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Article", "@id": "https://pythonjishu.com/ywonfrqlwkjagfq/", "url": "https://pythonjishu.com/ywonfrqlwkjagfq/", "headline": "JQuery解析HTML、JSON和XML实例详解", "description": "JQuery解析HTML、JSON和XML实例详解 1. HTML解析 1.1. 使用.text()方法解析HTML 1.1.1. 代码示例 <!-- HTML文本 --> <div id="content"> <p>Hello, World!</p>…", "datePublished": "2023-05-27T12:01:23+08:00", "dateModified": "2023-05-27T12:01:23+08:00", "author": {"@type":"Person","name":"Python技术站官方","url":"/1","image":"//pythonjishu.com/wp-content/uploads/2018/07/f9352ad8b4a1ce8c616fe60de409e340.jpg"} } </script> </body> </html> <!-- Cached by WP-Optimize (gzip) - https://getwpo.com - Last modified: 2024年11月11日 am5:45 (Asia/Shanghai UTC:8) -->