小编use*_*012的帖子

如何使用Python从HTML获取href链接?

import urllib2

website = "WEBSITE"
openwebsite = urllib2.urlopen(website)
html = getwebsite.read()

print html
Run Code Online (Sandbox Code Playgroud)

到现在为止还挺好.

但我只希望纯文本HTML中的href链接.我怎么解决这个问题?

html python beautifulsoup href hyperlink

41
推荐指数
8
解决办法
12万
查看次数

标签 统计

beautifulsoup ×1

href ×1

html ×1

hyperlink ×1

python ×1