Python爬虫: 抓取One网页上的每日一话和图

原文出处: 取水    

先说下需求:

最近打算搜集点源数据,丰富下生活。嗯,最近看到One这个APP蛮好的。每天想你推送一张图和一段话。很喜欢,简单不复杂。而我想要把所有的句子都保存下来,又不想要每个页面都去手动查看。因此,就有了Python。之前有点Python基础,不过没有深入。现在也没有深入,用哪学哪吧。
网站的内容是这样的,我想要图片和这段话:

 

(一)

一台MAC电脑

(二)Python环境搭建(所有命令都是在terminal中输入的)

  • 安装homebrew

    Shell

    1
    /usr/bin/ruby e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

  • 安装pip:这里我在terminal中输入python -v,homebrew会自动帮你升级Python到2.7.11版本的。2.7.11版本里自带了pip工具。
  • 安装virtualenv:

    Shell

    1
    pip install virtualenv

  • 安装request和beautifulsoup4:

    Shell

    1
    pip install requests beautifulsoup4



    参考这里

(三)分析
目的:找出三个内容所在的网页标签的位置,然后将它们提取出来。
网址:http://wufazhuce.com/one/1293
谷歌浏览器,右键->显示网页源代码,然后就会弹出一堆HTML的东西了。这样的:

 

网页源文件

我想要的内容是这段话:“即使热恋者的情感是错觉、幻象或自恋行为,那又何妨,所谓人生就是一段不断追求情爱的路程。 by 森山大道”。它在图中画红线的地方。在标签里的中,之后会用到,先往下看。
图片的链接在哪里?显然不在中,往下找,然后就在中,发现2处和图片类似的链接。看图

 

图片链接地址

哪个链接是呢,点击去,发现后一个链接,也就是67行这个img标签的链接是。
然后,我还想知道哪一天的图和文字。嗯,在回到标签里,很明显有个,里面的东西就是我们要的。这样:</p> <p><title>VOL.1271 – 「ONE · 一个」


(四)python编码
想要抓取网页上的内容,又不想自己去解析HTML,只好求助万能的Google了。然后就找到了上面的链接。主要有两个工具:request加载网页,BeautifulSoup4解析HTML。

首先,抓取我们需要的哪三个内容:
进入python环境,然后敲入下面的代码:

Python

1
2
3
4
import requests
import bs4
response = requests.get(‘http://wufazhuce.com/one/1295’)
soup = bs4.BeautifulSoup(response.text,“html.parser”)


这样,就可以将网页信息存储到soup中了。你可以敲入print soup试试。

接下来,我们获得VOL.1271 – 「ONE · 一个」中的数字1271。怎么获得呢,beautifulsoup4教程,提供了很好的方法,可以通过tag查找得到title的内容,然后截取字符串。termianl中输入:

Python

1
soup.title.string[3:7]

title是tag值,string是tag=title的字符串的值,也就是之间的值,因为只有一个tag,所以不用做判断,直接获取即可。</p> <p>接下来,获取一段话。</p> <div><img alt="" src="http://jbcdn2.b0.upaiyun.com/2016/04/344d0dfae97318d718e17afb0488ad9e.png">这段话在<meta><code></code>中,而这里又有太多的<meta><code></code>了,怎么办。这里要用到select方法了,它可以查找所有的<meta><code></code>,并返回一个列表。还要用到get方法,get可以获得tag的属性,如tag: <meta  attr=’abc’> tag.get(‘attr’)值等于abc。这里我们要获取的属性是name,通过name=’description’来区分。 </div> </p> <p><!-- Crayon Syntax Highlighter v2.7.1.1 --></p> <div id="crayon-585001a12c52f813166839" data-settings=" minimize scroll-always"> <div data-settings=" show"><span></span></p> <div> <div title="切换是否显示行编号"> <div></div> </div> <div title="纯文本显示代码"> <div></div> </div> <div title="切换自动换行"> <div></div> </div> <div title="点击展开代码"> <div></div> </div> <div title="复制代码"> <div></div> </div> <div title="在新窗口中显示代码"> <div></div> </div> </div> </div> <div></div> <div></div> <div> <table> <tr> <td data-settings="show"> <div> <div data-line="crayon-585001a12c52f813166839-1">1</div> <div data-line="crayon-585001a12c52f813166839-2">2</div> <div data-line="crayon-585001a12c52f813166839-3">3</div> </div> </td> <td> <div> <div id="crayon-585001a12c52f813166839-1"><span>for</span><span> </span><span>meta </span><span>in</span><span> </span><span>soup</span><span>.</span><span>select</span><span>(</span><span>‘meta’</span><span>)</span><span>:</span></div> <div id="crayon-585001a12c52f813166839-2"><span>    </span><span>if</span><span> </span><span>meta</span><span>.</span><span>get</span><span>(</span><span>‘name’</span><span>)</span><span> </span><span>==</span><span> </span><span>‘description’</span><span>:</span></div> <div id="crayon-585001a12c52f813166839-3"><span>        </span><span>print </span><span>meta</span><span>.</span><span>get</span><span>(</span><span>‘content’</span><span>)</span></div> </div> </td> </tr> </table> </div></div> <p><!-- [Format Time: 0.0010 seconds] --></p> <p>接下来,在两个img标签中,查找第2个img标签标定的链接。这里通过find_all方法,它可以查找所有的符合要求的标签。</p> <p><!-- Crayon Syntax Highlighter v2.7.1.1 --></p> <div id="crayon-585001a12c535777513118" data-settings=" minimize scroll-always"> <div data-settings=" show"><span></span></p> <div> <div title="切换是否显示行编号"> <div></div> </div> <div title="纯文本显示代码"> <div></div> </div> <div title="切换自动换行"> <div></div> </div> <div title="点击展开代码"> <div></div> </div> <div title="复制代码"> <div></div> </div> <div title="在新窗口中显示代码"> <div></div> </div> </div> </div> <div></div> <div></div> <div> <table> <tr> <td data-settings="show"> <div> <div data-line="crayon-585001a12c535777513118-1">1</div> </div> </td> <td> <div> <div id="crayon-585001a12c535777513118-1"><span>soup</span><span>.</span><span>find_all</span><span>(</span><span>‘img’</span><span>)</span><span>[</span><span>1</span><span>]</span><span>[</span><span>‘src’</span><span>]</span></div> </div> </td> </tr> </table> </div></div> <p><!-- [Format Time: 0.0005 seconds] --></p> <p>这样,我们就把所需要的信息找出来了。</p> <div><img alt="" src="http://jbcdn2.b0.upaiyun.com/2016/04/0199125f59e48a6d1bc2a6757bd4e06e.png"> </p> <div>终端示例</div> </div> <p>等等,之后我们还需要并发和保存文件。在此之前,先来看点别的。map函数有两个参数,一个是函数,一个是序列。将序列的每个值,作为参数传递给函数,返回一个列表。参考<a href="http://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/00141861202544241651579c69d4399a9aa135afef28c44000" target="_blank">这里</a><br /> 示例:</p> <p><!-- Crayon Syntax Highlighter v2.7.1.1 --></p> <div id="crayon-585001a12c53c220031891" data-settings=" minimize scroll-always"> <div data-settings=" show"><span></span></p> <div> <div title="切换是否显示行编号"> <div></div> </div> <div title="纯文本显示代码"> <div></div> </div> <div title="切换自动换行"> <div></div> </div> <div title="点击展开代码"> <div></div> </div> <div title="复制代码"> <div></div> </div> <div title="在新窗口中显示代码"> <div></div> </div> </div> </div> <div></div> <div></div> <div> <table> <tr> <td data-settings="show"> <div> <div data-line="crayon-585001a12c53c220031891-1">1</div> <div data-line="crayon-585001a12c53c220031891-2">2</div> <div data-line="crayon-585001a12c53c220031891-3">3</div> <div data-line="crayon-585001a12c53c220031891-4">4</div> <div data-line="crayon-585001a12c53c220031891-5">5</div> </div> </td> <td> <div> <div id="crayon-585001a12c53c220031891-1"><span>def </span><span>echoInfo</span><span>(</span><span>num</span><span>)</span><span>:</span></div> <div id="crayon-585001a12c53c220031891-2"><span>    </span><span>return</span><span> </span><span>num</span></div> <div id="crayon-585001a12c53c220031891-3"> </div> <div id="crayon-585001a12c53c220031891-4"><span>data</span><span> </span><span>=</span><span> </span><span>map</span><span>(</span><span>echoInfo</span><span>,</span><span> </span><span>range</span><span>(</span><span>0</span><span>,</span><span>10</span><span>)</span><span>)</span></div> <div id="crayon-585001a12c53c220031891-5"><span>print </span><span>data</span></div> </div> </td> </tr> </table> </div></div> <p><!-- [Format Time: 0.0008 seconds] --></p> <p>结果: <code>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]</code><br /> 然后<a href="http://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/0013868323401155ceb3db1e2044f80b974b469eb06cb43000" target="_blank">并发</a>, python可以跨平台使用,自身提供了多进程支持模块:multiprocessing。而pool可以用来创建大量的子进程。<br /> 保存数据到文件。这里我们是吧数据解析后存储到字典中,然后序列化为JSON模型,最后保存到文件的。<br /> 即:字典->JSON模型->存储到文件。<br /> 字典->JSON模型,使用的是JSON模块的json.dumps方法,该方法有一个参数,参数为字典,返回值是JSON字符串。<br /> JSON模型->文件,使用的是json.load方法,可以将JSON存储到文件中。</p> <p>全部的代码示例如下:</p> <p><!-- Crayon Syntax Highlighter v2.7.1.1 --></p> <div id="crayon-585001a12c543764125932" data-settings=" minimize scroll-always"> <div data-settings=" show"><span></span></p> <div> <div title="切换是否显示行编号"> <div></div> </div> <div title="纯文本显示代码"> <div></div> </div> <div title="切换自动换行"> <div></div> </div> <div title="点击展开代码"> <div></div> </div> <div title="复制代码"> <div></div> </div> <div title="在新窗口中显示代码"> <div></div> </div> </div> </div> <div></div> <div></div> <div> <table> <tr> <td data-settings="show"> <div> <div data-line="crayon-585001a12c543764125932-1">1</div> <div data-line="crayon-585001a12c543764125932-2">2</div> <div data-line="crayon-585001a12c543764125932-3">3</div> <div data-line="crayon-585001a12c543764125932-4">4</div> <div data-line="crayon-585001a12c543764125932-5">5</div> <div data-line="crayon-585001a12c543764125932-6">6</div> <div data-line="crayon-585001a12c543764125932-7">7</div> <div data-line="crayon-585001a12c543764125932-8">8</div> <div data-line="crayon-585001a12c543764125932-9">9</div> <div data-line="crayon-585001a12c543764125932-10">10</div> <div data-line="crayon-585001a12c543764125932-11">11</div> <div data-line="crayon-585001a12c543764125932-12">12</div> <div data-line="crayon-585001a12c543764125932-13">13</div> <div data-line="crayon-585001a12c543764125932-14">14</div> <div data-line="crayon-585001a12c543764125932-15">15</div> <div data-line="crayon-585001a12c543764125932-16">16</div> <div data-line="crayon-585001a12c543764125932-17">17</div> <div data-line="crayon-585001a12c543764125932-18">18</div> <div data-line="crayon-585001a12c543764125932-19">19</div> <div data-line="crayon-585001a12c543764125932-20">20</div> <div data-line="crayon-585001a12c543764125932-21">21</div> <div data-line="crayon-585001a12c543764125932-22">22</div> <div data-line="crayon-585001a12c543764125932-23">23</div> <div data-line="crayon-585001a12c543764125932-24">24</div> <div data-line="crayon-585001a12c543764125932-25">25</div> <div data-line="crayon-585001a12c543764125932-26">26</div> <div data-line="crayon-585001a12c543764125932-27">27</div> <div data-line="crayon-585001a12c543764125932-28">28</div> <div data-line="crayon-585001a12c543764125932-29">29</div> <div data-line="crayon-585001a12c543764125932-30">30</div> <div data-line="crayon-585001a12c543764125932-31">31</div> <div data-line="crayon-585001a12c543764125932-32">32</div> <div data-line="crayon-585001a12c543764125932-33">33</div> <div data-line="crayon-585001a12c543764125932-34">34</div> <div data-line="crayon-585001a12c543764125932-35">35</div> <div data-line="crayon-585001a12c543764125932-36">36</div> <div data-line="crayon-585001a12c543764125932-37">37</div> <div data-line="crayon-585001a12c543764125932-38">38</div> <div data-line="crayon-585001a12c543764125932-39">39</div> <div data-line="crayon-585001a12c543764125932-40">40</div> <div data-line="crayon-585001a12c543764125932-41">41</div> <div data-line="crayon-585001a12c543764125932-42">42</div> </div> </td> <td> <div> <div id="crayon-585001a12c543764125932-1"><span>import </span><span>argparse</span></div> <div id="crayon-585001a12c543764125932-2"><span>import </span><span>re</span></div> <div id="crayon-585001a12c543764125932-3"><span>from </span><span>multiprocessing </span><span>import </span><span>Pool</span></div> <div id="crayon-585001a12c543764125932-4"><span>import </span><span>requests</span></div> <div id="crayon-585001a12c543764125932-5"><span>import </span><span>bs4</span></div> <div id="crayon-585001a12c543764125932-6"><span>import </span><span>time</span></div> <div id="crayon-585001a12c543764125932-7"><span>import </span><span>json</span></div> <div id="crayon-585001a12c543764125932-8"><span>import </span><span>io</span></div> <div id="crayon-585001a12c543764125932-9"> </div> <div id="crayon-585001a12c543764125932-10"><span>root_url</span><span> </span><span>=</span><span> </span><span>‘http://wufazhuce.com’</span></div> <div id="crayon-585001a12c543764125932-11"> </div> <div id="crayon-585001a12c543764125932-12"><span>def </span><span>get_url</span><span>(</span><span>num</span><span>)</span><span>:</span></div> <div id="crayon-585001a12c543764125932-13"><span>    </span><span>return</span><span> </span><span>root_url</span><span> </span><span>+</span><span> </span><span>‘/one/’</span><span> </span><span>+</span><span> </span><span>str</span><span>(</span><span>num</span><span>)</span></div> <div id="crayon-585001a12c543764125932-14"> </div> <div id="crayon-585001a12c543764125932-15"><span>def </span><span>get_urls</span><span>(</span><span>num</span><span>)</span><span>:</span></div> <div id="crayon-585001a12c543764125932-16"><span>    </span><span>urls</span><span> </span><span>=</span><span> </span><span>map</span><span>(</span><span>get_url</span><span>,</span><span> </span><span>range</span><span>(</span><span>100</span><span>,</span><span>100</span><span>+</span><span>num</span><span>)</span><span>)</span></div> <div id="crayon-585001a12c543764125932-17"><span>    </span><span>return</span><span> </span><span>urls</span></div> <div id="crayon-585001a12c543764125932-18"> </div> <div id="crayon-585001a12c543764125932-19"><span>def </span><span>get_data</span><span>(</span><span>url</span><span>)</span><span>:</span></div> <div id="crayon-585001a12c543764125932-20"><span>  </span><span>dataList</span><span> </span><span>=</span><span> </span><span>{</span><span>}</span></div> <div id="crayon-585001a12c543764125932-21"><span>  </span><span>response</span><span> </span><span>=</span><span> </span><span>requests</span><span>.</span><span>get</span><span>(</span><span>url</span><span>)</span></div> <div id="crayon-585001a12c543764125932-22"><span>  </span><span>if</span><span> </span><span>response</span><span>.</span><span>status_code</span><span> </span><span>!=</span><span> </span><span>200</span><span>:</span></div> <div id="crayon-585001a12c543764125932-23"><span>      </span><span>return</span><span> </span><span>{</span><span>‘noValue’</span><span>:</span><span> </span><span>‘noValue’</span><span>}</span></div> <div id="crayon-585001a12c543764125932-24"><span>  </span><span>soup</span><span> </span><span>=</span><span> </span><span>bs4</span><span>.</span><span>BeautifulSoup</span><span>(</span><span>response</span><span>.</span><span>text</span><span>,</span><span>“html.parser”</span><span>)</span></div> <div id="crayon-585001a12c543764125932-25"><span>  </span><span>dataList</span><span>[</span><span>“index”</span><span>]</span><span> </span><span>=</span><span> </span><span>soup</span><span>.</span><span>title</span><span>.</span><span>string</span><span>[</span><span>4</span><span>:</span><span>7</span><span>]</span></div> <div id="crayon-585001a12c543764125932-26"><span>  </span><span>for</span><span> </span><span>meta </span><span>in</span><span> </span><span>soup</span><span>.</span><span>select</span><span>(</span><span>‘meta’</span><span>)</span><span>:</span></div> <div id="crayon-585001a12c543764125932-27"><span>    </span><span>if</span><span> </span><span>meta</span><span>.</span><span>get</span><span>(</span><span>‘name’</span><span>)</span><span> </span><span>==</span><span> </span><span>‘description’</span><span>:</span></div> <div id="crayon-585001a12c543764125932-28"><span>      </span><span>dataList</span><span>[</span><span>“content”</span><span>]</span><span> </span><span>=</span><span> </span><span>meta</span><span>.</span><span>get</span><span>(</span><span>‘content’</span><span>)</span></div> <div id="crayon-585001a12c543764125932-29"><span>  </span><span>dataList</span><span>[</span><span>“imgUrl”</span><span>]</span><span> </span><span>=</span><span> </span><span>soup</span><span>.</span><span>find_all</span><span>(</span><span>‘img’</span><span>)</span><span>[</span><span>1</span><span>]</span><span>[</span><span>‘src’</span><span>]</span></div> <div id="crayon-585001a12c543764125932-30"><span>  </span><span>return</span><span> </span><span>dataList</span></div> <div id="crayon-585001a12c543764125932-31"> </div> <div id="crayon-585001a12c543764125932-32"><span>if</span><span> </span><span>__name__</span><span>==</span><span>‘__main__’</span><span>:</span></div> <div id="crayon-585001a12c543764125932-33"><span>  </span><span>pool</span><span> </span><span>=</span><span> </span><span>Pool</span><span>(</span><span>4</span><span>)</span></div> <div id="crayon-585001a12c543764125932-34"><span>  </span><span>dataList</span><span> </span><span>=</span><span> </span><span>[</span><span>]</span></div> <div id="crayon-585001a12c543764125932-35"><span>  </span><span>urls</span><span> </span><span>=</span><span> </span><span>get_urls</span><span>(</span><span>10</span><span>)</span></div> <div id="crayon-585001a12c543764125932-36"><span>  </span><span>start</span><span> </span><span>=</span><span> </span><span>time</span><span>.</span><span>time</span><span>(</span><span>)</span></div> <div id="crayon-585001a12c543764125932-37"><span>  </span><span>dataList</span><span> </span><span>=</span><span> </span><span>pool</span><span>.</span><span>map</span><span>(</span><span>get_data</span><span>,</span><span> </span><span>urls</span><span>)</span></div> <div id="crayon-585001a12c543764125932-38"><span>  </span><span>end</span><span> </span><span>=</span><span> </span><span>time</span><span>.</span><span>time</span><span>(</span><span>)</span></div> <div id="crayon-585001a12c543764125932-39"><span>  </span><span>print</span><span> </span><span>‘use: %.2f s’</span><span> </span><span>%</span><span> </span><span>(</span><span>end</span><span> </span><span>–</span><span> </span><span>start</span><span>)</span></div> <div id="crayon-585001a12c543764125932-40"><span>  </span><span>jsonData</span><span> </span><span>=</span><span> </span><span>json</span><span>.</span><span>dumps</span><span>(</span><span>{</span><span>‘data’</span><span>:</span><span>dataList</span><span>}</span><span>)</span></div> <div id="crayon-585001a12c543764125932-41"><span>  </span><span>with </span><span>open</span><span>(</span><span>‘data.txt’</span><span>,</span><span> </span><span>‘w’</span><span>)</span><span> </span><span>as</span><span> </span><span>outfile</span><span>:</span></div> <div id="crayon-585001a12c543764125932-42"><span>    </span><span>json</span><span>.</span><span>dump</span><span>(</span><span>jsonData</span><span>,</span><span> </span><span>outfile</span><span>)</span></div> </div> </td> </tr> </table> </div></div> <p><!-- [Format Time: 0.0065 seconds] --></p> <p><div> <span data-post-id="84714"><i></i> <h10 id="84714votetotal">1</h10> 赞</span><br /> <span data-book-type="1" data-site-id="13" data-item-id="84714" data-item-type="1"><i></i> 12 收藏</span></p> <p> <a href="#article-comment"><span><i></i> 3 评论</span></a></p> <p> <!-- JiaThis Button BEGIN --></p> <div> <a></a><br /> <a></a><br /> <a></a><br /> <a></a><br /> <a href="http://www.jiathis.com/share?uid=1745061" target="_blank"></a> </div> </p></div> <p> <!-- BEGIN #author-bio --></p> <p><!-- END #author-bio --> </div> <p>转载自演道,想查看更及时的互联网产品技术热点文章请点击<a href="http://go2live.cn">http://go2live.cn</a></p> </div><!-- .entry-content --> <footer class="entry-meta"> </footer><!-- .entry-meta --> </article><!-- #post --> <nav class="navigation post-navigation" role="navigation"> <h1 class="screen-reader-text">文章导航</h1> <div class="nav-links"> <a href="https://www.go2live.cn/program/python/%e4%b8%ba%e4%bb%80%e4%b9%88%e5%af%b9%e6%95%b0%e7%bb%84%e6%8e%92%e5%ba%8f%e8%ae%a9python%e5%be%aa%e7%8e%af%e8%bf%90%e8%a1%8c%e6%9b%b4%e5%bf%ab.html" rel="prev"><span class="meta-nav">←</span> 为什么对数组排序让Python循环运行更快</a> <a href="https://www.go2live.cn/dev/swoole2-0%e5%86%85%e7%bd%ae%e5%8d%8f%e7%a8%8b%e5%b9%b6%e5%8f%91%e6%b5%8b%e8%af%95-%e6%bc%94%e9%81%93%e7%bd%91.html" rel="next">Swoole2.0内置协程并发测试-演道网 <span class="meta-nav">→</span></a> </div><!-- .nav-links --> </nav><!-- .navigation --> <div id="comments" class="comments-area"> <div id="respond" class="comment-respond"> <h3 id="reply-title" class="comment-reply-title">发表评论 <small><a rel="nofollow" id="cancel-comment-reply-link" href="/program/python/python%E7%88%AC%E8%99%AB-%E6%8A%93%E5%8F%96one%E7%BD%91%E9%A1%B5%E4%B8%8A%E7%9A%84%E6%AF%8F%E6%97%A5%E4%B8%80%E8%AF%9D%E5%92%8C%E5%9B%BE.html#respond" style="display:none;">取消回复</a></small></h3> <form action="https://www.go2live.cn/wp-comments-post.php" method="post" id="commentform" class="comment-form" novalidate> <p class="comment-notes"><span id="email-notes">电子邮件地址不会被公开。</span> 必填项已用<span class="required">*</span>标注</p><p class="comment-form-comment"><label for="comment">评论</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" required="required"></textarea></p><p class="comment-form-author"><label for="author">姓名 <span class="required">*</span></label> <input id="author" name="author" type="text" value="" size="30" maxlength="245" required='required' /></p> <p class="comment-form-email"><label for="email">电子邮件 <span class="required">*</span></label> <input id="email" name="email" type="email" value="" size="30" maxlength="100" aria-describedby="email-notes" required='required' /></p> <p class="comment-form-url"><label for="url">站点</label> <input id="url" name="url" type="url" value="" size="30" maxlength="200" /></p> <p class="form-submit"><input name="submit" type="submit" id="submit" class="submit" value="发表评论" /> <input type='hidden' name='comment_post_ID' value='179224' id='comment_post_ID' /> <input type='hidden' name='comment_parent' id='comment_parent' value='0' /> </p> </form> </div><!-- #respond --> </div><!-- #comments --> </div><!-- #content --> </div><!-- #primary --> </div><!-- #main --> <footer id="colophon" class="site-footer" role="contentinfo"> <div id="secondary" class="sidebar-container" role="complementary"> <div class="widget-area"> <aside id="pages-10" class="widget widget_pages"><h3 class="widget-title">页面</h3> <ul> <li class="page_item page-item-86"><a href="https://www.go2live.cn/it%e4%bc%81%e4%b8%9a">互联网it企业一览</a></li> <li class="page_item page-item-135484"><a href="https://www.go2live.cn/%e5%85%b3%e4%ba%8e">关于</a></li> <li class="page_item page-item-4972"><a href="https://www.go2live.cn/%e6%bc%94%e9%81%93%e5%85%ac%e4%bc%97%e5%8f%b7%e8%ae%a2%e9%98%85%e8%af%b4%e6%98%8e">演道公众号订阅说明</a></li> <li class="page_item page-item-72"><a href="https://www.go2live.cn/%e8%8b%b1%e6%96%87%e5%9c%b0%e5%9d%80%e5%86%99%e6%b3%95">英文地址写法</a></li> </ul> </aside> </div><!-- .widget-area --> </div><!-- #secondary --> <div class="site-info"> <a href="http://www.miitbeian.gov.cn/" rel="nofollow" title="工业和信息化部ICP/IP地址/域名信息备案管理系统">京ICP备16029834号-1</a> <a href="https://cn.wordpress.org/" class="imprint"> 自豪地采用WordPress </a> </div><!-- .site-info --> </footer><!-- #colophon --> </div><!-- #page --> <link rel='stylesheet' id='hljstheme-css' href='https://www.go2live.cn/wp-content/plugins/wp-code-highlightjs/styles/github.css?ver=0.6.2' type='text/css' media='all' /> <script type='text/javascript' src='https://www.go2live.cn/wp-includes/js/comment-reply.min.js?ver=4.9.8'></script> <script type='text/javascript' src='https://www.go2live.cn/wp-includes/js/imagesloaded.min.js?ver=3.2.0'></script> <script type='text/javascript' src='https://www.go2live.cn/wp-includes/js/masonry.min.js?ver=3.3.2'></script> <script type='text/javascript' src='https://www.go2live.cn/wp-includes/js/jquery/jquery.masonry.min.js?ver=3.1.2b'></script> <script type='text/javascript' src='https://www.go2live.cn/wp-content/themes/twentythirteen/js/functions.js?ver=20160717'></script> <script type='text/javascript' src='https://www.go2live.cn/wp-includes/js/wp-embed.min.js?ver=4.9.8'></script> <script type='text/javascript' src='https://www.go2live.cn/wp-content/plugins/wp-code-highlightjs/highlight.common.pack.js?ver=0.6.2'></script> <script type='text/javascript' src='https://www.go2live.cn/wp-content/plugins/wp-code-highlightjs/highlight.custom.pack.js?ver=0.6.2'></script> <style>pre.hljs {padding: 5px;} pre.hljs code {}</style> <script type="text/javascript"> (function($, window) { var init_fn_flag = false; var init_fn = (function() { if (init_fn_flag) return; init_fn_flag = true; hljs.configure({"tabReplace":" "}); $('pre code').each(function(i, block) { hljs.highlightBlock(block); }); $('pre:not(:has(code))').each(function(i, block){ var class_desc = $(block).attr("class") || ""; var reg_mat = class_desc.match(/brush\s*:\s*([\w\d]+)/i); if(!reg_mat || reg_mat.length < 2) return; var code_content = $(block).removeClass("brush:").removeClass("ruler:").removeClass("first-line:").removeClass("highlight:") .removeClass("brush:" + reg_mat[1] + ";").removeClass(reg_mat[1] + ";").removeClass("true;").removeClass("false;").html(); $(block).empty().append($("<code class='hljs'></code>").html(code_content)).addClass(reg_mat[1]); hljs.highlightBlock(block); }); }); $(document).ready(init_fn); $(window).on("load", init_fn); })(jQuery, window); </script> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?5786089ac0012a9bddcaa1c96560ca10"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> </body> </html>