{"id":861,"date":"2021-01-27T23:05:52","date_gmt":"2021-01-27T15:05:52","guid":{"rendered":"https:\/\/byy3.com\/?p=861"},"modified":"2021-01-27T23:05:52","modified_gmt":"2021-01-27T15:05:52","slug":"python3%e4%bd%bf%e7%94%a8newspaper%e5%ba%93%e6%8f%90%e5%8f%96%e6%96%b0%e9%97%bb%e5%86%85%e5%ae%b9readability%ef%bc%8cjparser","status":"publish","type":"post","link":"https:\/\/byy3.com\/?p=861","title":{"rendered":"python3\u4f7f\u7528newspaper\u5e93\u63d0\u53d6\u65b0\u95fb\u5185\u5bb9(readability\uff0cjparser)"},"content":{"rendered":"<p>\u4e4b\u524d\u4f7f\u7528\u5176\u4ed6\u65b9\u6cd5\uff0c\u8bf8\u5982xpath\uff0ccss\uff0c\u6b63\u5219\u8868\u8fbe\u5f0f\uff0cbeautifulsoup\u6765\u89e3\u6790\u65b0\u95fb\u9875\u9762\u7684\u65f6\u5019\uff0c\u603b\u662f\u4f1a\u9047\u5230\u8fd9\u6837\u90a3\u6837\u5404\u79cd\u5947\u5947\u602a\u602a\u7684\u95ee\u9898\uff0c\u8ba9\u4eba\u5f88\u5934\u75bc\u3002<\/p>\n<p>\u6700\u8fd1\u5b66\u5230\u4e00\u4e2a\u65b0\u7684\u5305newspaper\uff0c\u7528\u6765\u6293\u53d6\u65b0\u95fb\u6b63\u6587\uff0c\u771f\u7684\u5f88\u597d\u7528\u5462\u3002<\/p>\n<p>\u8fd9\u4e2a\u5305\u662f\u9700\u8981\u81ea\u5df1\u91cd\u65b0\u5b89\u88c5\u7684\uff0c\u6211\u4f7f\u7528\u7684\u662fpycharm\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"has\" data-original=\"https:\/\/img-blog.csdn.net\/20180725222139899?watermark\/2\/text\/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MTkzMTYwMg==\/font\/5a6L5L2T\/fontsize\/400\/fill\/I0JBQkFCMA==\/dissolve\/70\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" width=\"1200\" height=\"990\" title=\"python3\u4f7f\u7528newspaper\u5e93\u63d0\u53d6\u65b0\u95fb\u5185\u5bb9(readability\uff0cjparser)\u63d2\u56fe\" alt=\"python3\u4f7f\u7528newspaper\u5e93\u63d0\u53d6\u65b0\u95fb\u5185\u5bb9(readability\uff0cjparser)\u63d2\u56fe\" \/>\u5728settings\u914d\u7f6e\u73af\u5883\uff0c\u6dfb\u52a0\u5305newspaper\u7684\u65f6\u5019\u603b\u662f\u6dfb\u52a0\u4e0d\u8fdb\u53bb\u3002\u90a3\u5c31pip\u5427\uff01<\/p>\n<p>\u4e8e\u662f\u6253\u5f00\u547d\u4ee4\u884c\u7a97\u53e3\uff0c\u8f93\u5165pip3 install --ignore-installed --upgrade newspaper3k\uff0c\u7b49\u5f85\u4e00\u4f1a\u5c31\u5b89\u88c5\u597d\u4e86\u3002<\/p>\n<p>\u5982\u679c\u6587\u7ae0\u6ca1\u6709\u6307\u660e\u4f7f\u7528\u7684\u4ec0\u4e48\u8bed\u8a00\u7684\u65f6\u5019\uff0cNewspaper\u4f1a\u5c1d\u8bd5\u81ea\u52a8\u8bc6\u522b\u3002<\/p>\n<pre class=\"has\"><code class=\"hljs coffeescript\"><\/code><\/pre>\n<ol class=\"hljs-ln\">\n<li>\n<div class=\"hljs-ln-numbers\">\n<div class=\"hljs-ln-line hljs-ln-n\" data-line-number=\"1\"><\/div>\n<\/div>\n<div class=\"hljs-ln-code\">\n<div class=\"hljs-ln-line\"><span class=\"hljs-keyword\">from<\/span> newspaper <span class=\"hljs-keyword\">import<\/span> Article<\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"hljs-ln-numbers\">\n<div class=\"hljs-ln-line hljs-ln-n\" data-line-number=\"2\"><\/div>\n<\/div>\n<div class=\"hljs-ln-code\">\n<div class=\"hljs-ln-line\">url = <span class=\"hljs-string\">'\u4f60\u60f3\u8981\u722c\u53d6\u7684\u7f51\u7ad9url'<\/span><\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"hljs-ln-numbers\">\n<div class=\"hljs-ln-line hljs-ln-n\" data-line-number=\"3\"><\/div>\n<\/div>\n<div class=\"hljs-ln-code\">\n<div class=\"hljs-ln-line\">news = Article(url, language=<span class=\"hljs-string\">'zh'<\/span>)<\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"hljs-ln-numbers\">\n<div class=\"hljs-ln-line hljs-ln-n\" data-line-number=\"4\"><\/div>\n<\/div>\n<div class=\"hljs-ln-code\">\n<div class=\"hljs-ln-line\">news .download()<\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"hljs-ln-numbers\">\n<div class=\"hljs-ln-line hljs-ln-n\" data-line-number=\"5\"><\/div>\n<\/div>\n<div class=\"hljs-ln-code\">\n<div class=\"hljs-ln-line\">news .parse()<\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"hljs-ln-numbers\">\n<div class=\"hljs-ln-line hljs-ln-n\" data-line-number=\"6\"><\/div>\n<\/div>\n<div class=\"hljs-ln-code\">\n<div class=\"hljs-ln-line\"><span class=\"hljs-built_in\">print<\/span>(news.text)<\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"hljs-ln-numbers\">\n<div class=\"hljs-ln-line hljs-ln-n\" data-line-number=\"7\"><\/div>\n<\/div>\n<div class=\"hljs-ln-code\">\n<div class=\"hljs-ln-line\"><span class=\"hljs-built_in\">print<\/span>(news.title)<\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"hljs-ln-numbers\">\n<div class=\"hljs-ln-line hljs-ln-n\" data-line-number=\"8\"><\/div>\n<\/div>\n<div class=\"hljs-ln-code\">\n<div class=\"hljs-ln-line\"><span class=\"hljs-built_in\">print<\/span>(news.html)<\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"hljs-ln-numbers\">\n<div class=\"hljs-ln-line hljs-ln-n\" data-line-number=\"9\"><\/div>\n<\/div>\n<div class=\"hljs-ln-code\">\n<div class=\"hljs-ln-line\"><span class=\"hljs-built_in\">print<\/span>(news.authors)<\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"hljs-ln-numbers\">\n<div class=\"hljs-ln-line hljs-ln-n\" data-line-number=\"10\"><\/div>\n<\/div>\n<div class=\"hljs-ln-code\">\n<div class=\"hljs-ln-line\"><span class=\"hljs-built_in\">print<\/span>(news.top_image)<\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"hljs-ln-numbers\">\n<div class=\"hljs-ln-line hljs-ln-n\" data-line-number=\"11\"><\/div>\n<\/div>\n<div class=\"hljs-ln-code\">\n<div class=\"hljs-ln-line\"><span class=\"hljs-built_in\">print<\/span>(news.movies)<\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"hljs-ln-numbers\">\n<div class=\"hljs-ln-line hljs-ln-n\" data-line-number=\"12\"><\/div>\n<\/div>\n<div class=\"hljs-ln-code\">\n<div class=\"hljs-ln-line\"><span class=\"hljs-built_in\">print<\/span>(news.keywords)<\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"hljs-ln-numbers\">\n<div class=\"hljs-ln-line hljs-ln-n\" data-line-number=\"13\"><\/div>\n<\/div>\n<div class=\"hljs-ln-code\">\n<div class=\"hljs-ln-line\"><span class=\"hljs-built_in\">print<\/span>(news.summary)<\/div>\n<\/div>\n<\/li>\n<\/ol>\n<pre class=\"has\"><code class=\"hljs coffeescript\"><\/code><\/pre>\n<div class=\"hljs-button signin\" data-title=\"\u767b\u5f55\u540e\u590d\u5236\" data-report-click=\"{&quot;spm&quot;:&quot;1001.2101.3001.4259&quot;}\"><\/div>\n<p>\u4e5f\u53ef\u4ee5\u76f4\u63a5\u5bfc\u5165\u5305,\u5982\u679c\u8bed\u8a00\u662f\u4e00\u81f4\u7684\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u58f0\u660e<\/p>\n<pre class=\"has\"><code class=\"hljs go\"><\/code><\/pre>\n<ol class=\"hljs-ln\">\n<li>\n<div class=\"hljs-ln-numbers\">\n<div class=\"hljs-ln-line hljs-ln-n\" data-line-number=\"1\"><\/div>\n<\/div>\n<div class=\"hljs-ln-code\">\n<div class=\"hljs-ln-line\"><span class=\"hljs-keyword\">import<\/span> newspaper<\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"hljs-ln-numbers\">\n<div class=\"hljs-ln-line hljs-ln-n\" data-line-number=\"2\"><\/div>\n<\/div>\n<div class=\"hljs-ln-code\">\n<div class=\"hljs-ln-line\">news = newspaper.build(url, language=<span class=\"hljs-string\">'zh'<\/span>)<\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"hljs-ln-numbers\">\n<div class=\"hljs-ln-line hljs-ln-n\" data-line-number=\"3\"><\/div>\n<\/div>\n<div class=\"hljs-ln-code\">\n<div class=\"hljs-ln-line\">article = news.articles[<span class=\"hljs-number\">0<\/span>]<\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"hljs-ln-numbers\">\n<div class=\"hljs-ln-line hljs-ln-n\" data-line-number=\"4\"><\/div>\n<\/div>\n<div class=\"hljs-ln-code\">\n<div class=\"hljs-ln-line\">article.download()<\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"hljs-ln-numbers\">\n<div class=\"hljs-ln-line hljs-ln-n\" data-line-number=\"5\"><\/div>\n<\/div>\n<div class=\"hljs-ln-code\">\n<div class=\"hljs-ln-line\">article.parse()<\/div>\n<\/div>\n<\/li>\n<li>\n<div class=\"hljs-ln-numbers\">\n<div class=\"hljs-ln-line hljs-ln-n\" data-line-number=\"6\"><\/div>\n<\/div>\n<div class=\"hljs-ln-code\">\n<div class=\"hljs-ln-line\"><span class=\"hljs-built_in\">print<\/span>(article.text)<\/div>\n<\/div>\n<\/li>\n<\/ol>\n<pre class=\"has\"><code class=\"hljs go\"><\/code><\/pre>\n<ul>\n<li>GitHub\uff1ahttps:\/\/github.com\/codelucas\/newspaper<\/li>\n<\/ul>\n<ul>\n<li>Newspaper\u6587\u6863\u8bf4\u660e\uff1ahttps:\/\/newspaper.readthedocs.io\/en\/latest\/<\/li>\n<li>Newspaper\u5feb\u901f\u5165\u95e8\uff1ahttps:\/\/newspaper.readthedocs.io\/en\/latest\/user_guide\/quickstart.html<\/li>\n<\/ul>\n<p><strong>Newspaper\u662f\u4e00\u4e2apython3\u5e93\u3002<\/strong><\/p>\n<p><strong>\u6ce8\uff1aNewspaper\u6846\u67b6\u5e76\u4e0d\u9002\u7528\u4e8e\u5b9e\u9645\u5de5\u7a0b\u7c7b\u65b0\u95fb\u4fe1\u606f\u722c\u53d6\u5de5\u4f5c\uff0c\u6846\u67b6\u4e0d\u7a33\u5b9a\uff0c\u722c\u53d6\u8fc7\u7a0b\u4e2d\u4f1a\u6709\u5404\u79cdbug\uff0c\u4f8b\u5982\u83b7\u53d6\u4e0d\u5230url\u3001\u65b0\u95fb\u4fe1\u606f\u7b49\uff0c\u4f46\u5bf9\u4e8e\u60f3\u83b7\u53d6\u4e00\u4e9b\u65b0\u95fb\u8bed\u6599\u7684\u670b\u53cb\u4e0d\u59a8\u4e00\u8bd5\uff0c\u7b80\u5355\u65b9\u4fbf\u6613\u4e0a\u624b\uff0c\u4e14\u4e0d\u9700\u8981\u638c\u63e1\u592a\u591a\u5173\u4e8e\u722c\u866b\u65b9\u9762\u7684\u4e13\u4e1a\u77e5\u8bc6\u3002<\/strong><\/p>\n<p>\u5b89\u88c5<\/p>\n<pre class=\"prettyprint\"><code class=\"has-numbering\">pip3 install newspaper3k\r\nor \r\npip3 install --ignore-installed --upgrade newspaper3k\r\n<\/code><\/pre>\n<p>\u5982\u679c\u6587\u7ae0\u6ca1\u6709\u6307\u660e\u4f7f\u7528\u7684\u4ec0\u4e48\u8bed\u8a00\u7684\u65f6\u5019\uff0cNewspaper\u4f1a\u5c1d\u8bd5\u81ea\u52a8\u8bc6\u522b\u3002\u652f\u630110\u591a\u79cd\u8bed\u8a00\u5e76\u4e14\u6240\u6709\u7684\u90fd\u662funicode\u7f16\u7801\u3002<\/p>\n<pre class=\"prettyprint\"><code class=\"has-numbering\">import time\r\nfrom newspaper import Article\r\n\r\nurl = 'https:\/\/www.chinaventure.com.cn\/news\/78-20190819-347269.html'\r\nurl='https:\/\/36kr.com\/p\/5237348'\r\n# \u521b\u5efa\u6587\u7ae0\u5bf9\u8c61\r\nnews = Article(url, language='zh')\r\n# \u4e0b\u8f7d\u7f51\u9875\r\nnews.download()\r\n## \u7f51\u9875\u89e3\u6790\r\nnews.parse()\r\nprint(\"title=\",news.title)# \u83b7\u53d6\u6587\u7ae0\u6807\u9898\r\nprint(\"author=\", news.authors) # \u83b7\u53d6\u6587\u7ae0\u4f5c\u8005\r\nprint(\"publish_date=\", news.publish_date) # \u83b7\u53d6\u6587\u7ae0\u65e5\u671f\r\n# \u81ea\u7136\u8bed\u8a00\u5904\u7406\r\nnews.nlp()\r\nprint('keywords=',news.keywords)#\u4ece\u6587\u672c\u4e2d\u63d0\u53d6\u5173\u952e\u5b57\r\nprint(\"summary=\",news.summary)# \u83b7\u53d6\u6587\u7ae0\u6458\u8981\r\n# time.sleep(30)\r\nprint(\"text=\",news.text,\"\\n\")# \u83b7\u53d6\u6587\u7ae0\u6b63\u6587\r\n\r\nprint(\"movies=\",news.movies) # \u83b7\u53d6\u6587\u7ae0\u89c6\u9891\u94fe\u63a5\r\nprint(\"top_iamge=\",news.top_image) # \u83b7\u53d6\u6587\u7ae0\u9876\u90e8\u56fe\u7247\u5730\u5740\r\nprint(\"images=\",news.images)#\u4ecehtml\u4e2d\u63d0\u53d6\u6240\u6709\u56fe\u50cf\r\nprint(\"imgs=\",news.imgs)\r\nprint(\"html=\",news.html)#\u83b7\u53d6html\r\n<\/code><\/pre>\n<p>\u4e5f\u53ef\u4ee5\u76f4\u63a5\u5bfc\u5165\u5305,\u5982\u679c\u8bed\u8a00\u662f\u4e00\u81f4\u7684\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u58f0\u660e<\/p>\n<pre class=\"prettyprint\"><code class=\"has-numbering\">import newspaper\r\n\r\nurl='http:\/\/www.coscocs.com\/'\r\n'''\u6ce8\uff1a\u6587\u7ae0\u7f13\u5b58\uff1a\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cnewspaper\u7f13\u5b58\u6240\u6709\u4ee5\u524d\u63d0\u53d6\u7684\u6587\u7ae0\uff0c\u5e76\u5220\u9664\u5b83\u5df2\u7ecf\u63d0\u53d6\u7684\u4efb\u4f55\u6587\u7ae0\u3002\r\n\u6b64\u529f\u80fd\u7528\u4e8e\u9632\u6b62\u91cd\u590d\u7684\u6587\u7ae0\u548c\u63d0\u9ad8\u63d0\u53d6\u901f\u5ea6\u3002\u53ef\u4ee5\u4f7f\u7528memoize_articles\u53c2\u6570\u9009\u62e9\u9000\u51fa\u6b64\u529f\u80fd\u3002'''\r\nnews = newspaper.build(url, language='zh', memoize_articles=False)\r\narticle = news.articles[0]\r\narticle.download()\r\narticle.parse()\r\nprint('text=',article.text)\r\nprint('brand=',news.brand) #\u63d0\u53d6\u6e90\u54c1\u724c\r\nprint('description=',news.description) # \u63d0\u53d6\u63cf\u8ff0\r\nprint(\"\u4e00\u5171\u83b7\u53d6%s\u7bc7\u6587\u7ae0\" % news.size()) # \u6587\u7ae0\u7684\u6570\u76ee\r\n\r\n# \u6240\u6709\u6587\u7ae0\u7684url\r\nfor article in news.articles:\r\n print(article.url)\r\n\r\n#\u63d0\u53d6\u6e90\u7c7b\u522b\r\nfor category in news.category_urls():\r\n print(category)\r\n\r\n#\u63d0\u53d6\u6e90\u63d0\u8981\r\nfor feed_url in news.feed_urls():\r\n print(feed_url)\r\n\r\n<\/code><\/pre>\n<p>\u6ce8\uff1a\u6587\u7ae0\u7f13\u5b58\uff1a\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cnewspaper\u7f13\u5b58\u6240\u6709\u4ee5\u524d\u63d0\u53d6\u7684\u6587\u7ae0\uff0c\u5e76\u5220\u9664\u5b83\u5df2\u7ecf\u63d0\u53d6\u7684\u4efb\u4f55\u6587\u7ae0\u3002\u6b64\u529f\u80fd\u7528\u4e8e\u9632\u6b62\u91cd\u590d\u7684\u6587\u7ae0\u548c\u63d0\u9ad8\u63d0\u53d6\u901f\u5ea6\u3002\u53ef\u4ee5\u4f7f\u7528<code>memoize_articles<\/code>\u53c2\u6570\u9009\u62e9\u9000\u51fa\u6b64\u529f\u80fd\u3002<\/p>\n<h3><a name=\"t0\"><\/a><a name=\"t0\"><\/a><a id=\"RequestsNewspaper_76\"><\/a>Requests\u548cNewspaper\u7ed3\u5408\u89e3\u6790\u6b63\u6587<\/h3>\n<pre class=\"prettyprint\"><code class=\"has-numbering\">import requests\r\nfrom newspaper import fulltext\r\n\r\nhtml = requests.get('https:\/\/www.washingtonpost.com\/business\/economy\/2019\/01\/17\/19662748-1a84-11e9-9ebf-c5fed1b7a081_story.html?utm_term=.26198c91916f').text\r\ntext = fulltext(html)\r\nprint(text)\r\n<\/code><\/pre>\n<h3><a name=\"t1\"><\/a><a name=\"t1\"><\/a><a id=\"Google_Trends_85\"><\/a>Google Trends\u4fe1\u606f<\/h3>\n<pre class=\"prettyprint\"><code class=\"has-numbering\">import newspaper\r\n\r\nprint(newspaper.languages())#\u83b7\u53d6\u652f\u6301\u7684\u8bed\u8a00\r\nprint(newspaper.hot())#hot()\u4f7f\u7528\u516c\u5171api\u8fd4\u56de\u8c37\u6b4c\u4e0a\u7684\u70ed\u95e8\u8bcd\u6c47\u5217\u8868\r\nprint(newspaper.popular_urls())#popular_urls()\u8fd4\u56de\u4e00\u4e2a\u6d41\u884c\u65b0\u95fb\u6e90url\u5217\u8868<\/code><a style=\"font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;\" name=\"t2\"><\/a><a style=\"font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;\" name=\"t2\"><\/a><a id=\"_93\" style=\"font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;\"><\/a><\/pre>\n<h3><a id=\"_93\"><\/a>\u591a\u4efb\u52a1<\/h3>\n<pre class=\"prettyprint\"><code class=\"has-numbering\">import newspaper\r\nfrom newspaper import news_pool\r\n\r\n# \u521b\u5efa\u5e76\u884c\u4efb\u52a1\r\nslate_paper = newspaper.build('http:\/\/slate.com')\r\ntc_paper = newspaper.build('http:\/\/techcrunch.com')\r\nespn_paper = newspaper.build('http:\/\/espn.com')\r\n\r\npapers = [slate_paper, tc_paper, espn_paper]\r\nnews_pool.set(papers, threads_per_source=2) # (3*2) = 6 \u51716\u4e2a\u7ebf\u7a0b\r\n\r\nnews_pool.join()\r\n\r\nprint(slate_paper.articles[10].html)\r\n<\/code><\/pre>\n<hr \/>\n<h2><a name=\"t3\"><\/a><a name=\"t3\"><\/a><a id=\"pythonreadability_112\"><\/a>python-readability<\/h2>\n<p><code>github<\/code>\u5730\u5740\u662f\uff1ahttps:\/\/github.com\/buriy\/python-readability<\/p>\n<p>\u5b89\u88c5<\/p>\n<pre class=\"prettyprint\"><code class=\"has-numbering\">pip install requests\r\npip install readability-lxml\r\n<\/code><\/pre>\n<p>\u4f7f\u7528\u65b9\u5f0f\uff1a<\/p>\n<pre class=\"prettyprint\"><code class=\"has-numbering\">import requests\r\nfrom readability import Document\r\nresponse = requests.get('https:\/\/news.163.com\/18\/1123\/13\/E1A4T8F40001899O.html')\r\ndoc = Document(response.text)\r\nprint doc.title()\r\nprint doc.content()\r\n<\/code><\/pre>\n<p>\u6d4b\u8bd5\u7ed3\u679c\uff1a\u6b63\u6587\u63d0\u53d6\u8303\u56f4\u592a\u5927\uff0c\u4e14\u4e71\u7801\uff0c\u4e0d\u597d\u7528\uff0c\u62ff\u5230\u7684\u6b63\u6587\u90e8\u5206\uff0c\u660e\u663e\u6709\u95ee\u9898\u3002\u800c\u4e14\u8fd8\u6709\u4e71\u7801\u95ee\u9898\u3002\u6240\u4ee5\uff0c\u4e0d\u5efa\u8bae\u4f7f\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e4b\u524d\u4f7f\u7528\u5176\u4ed6\u65b9\u6cd5\uff0c\u8bf8\u5982xpath\uff0ccss\uff0c\u6b63\u5219\u8868\u8fbe\u5f0f\uff0cbeautifulsoup\u6765\u89e3\u6790\u65b0\u95fb\u9875\u9762\u7684\u65f6\u5019\uff0c\u603b\u662f\u4f1a\u9047 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,15],"tags":[405,404,33,352,16,403],"class_list":["post-861","post","type-post","status-publish","format-standard","hentry","category-python","category-wordpress","tag-newspaper","tag-python","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts\/861","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=861"}],"version-history":[{"count":0,"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts\/861\/revisions"}],"wp:attachment":[{"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}