python如何将爬取的网站url,变成超链接的形式
黄舟
黄舟 2017-04-18 10:25:28
0
2
883

**这是我爬取的内容,写到了txt文本中,我想让它变成超链接的形式。
没有url,直接文字就可以进去到相关的页面。**我该怎么做呢?

求大神指点,先行谢过。

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(2)
阿神

To use hyperlinks, you must have documents in a format that supports hyperlinks.

txt不支持超链接,你可以用html

Save these two contents of yours as:

<html>
    <head>
        <meta charset='utf-8'>
    </head>
    
    <body>
        <a href="[url]">[name]</a>
    </body>
<html>

Which [url]用你爬到的连接替换,[name]用你爬到的标题替换,增加<a> tag would be nice.

If you don’t understand<a>what a tag is, just look at this: http://www.runoob.com/tags/ta...

PHPzhong

It is recommended that you learn the basics of html

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template