美文网首页
链接提取

链接提取

作者: 陨星落云 | 来源:发表于2019-02-14 13:48 被阅读9次
page =('</head><body><div id="header"><div class="mdiv"><div class="t-top"><a href="http://www.cnki.net" target="_blank">中国知网</a> |')
start_link =page.find('<a href=')
start_quote=page.find('"',start_link)#在start_link后,查找"的位置
#print (start_quote)
end_quote=page.find('"',start_quote+1)#在start_quote后,查找"的位置
#print (end_quote)
url=page[start_quote+1:end_quote]
print (url)

http://www.cnki.net

相关文章

网友评论

      本文标题:链接提取

      本文链接:https://www.haomeiwen.com/subject/uvheeqtx.html