使用Python从HTML提供URL
RSS提要URL可用于站点的元数据(如果可用)。有没有一种方法可以使用使用Python从HTML提供URL,python,html-parsing,urllib2,Python,Html Parsing,Urllib2,RSS提要URL可用于站点的元数据(如果可用)。有没有一种方法可以使用urlib2或HTMLParser模块提取页面的提要URL?还是有更好的模块可用 谢谢。我更喜欢。它有一个非常好的API,而且它的XPath支持使得实现这一点相当简单: import lxml.html doc = lxml.html.parse(url_to_site) feeds = doc.xpath('//link[@type="application/rss+xml"]/@href') # list feed url
urlib2
或HTMLParser
模块提取页面的提要URL?还是有更好的模块可用
谢谢。我更喜欢。它有一个非常好的API,而且它的XPath支持使得实现这一点相当简单:
import lxml.html
doc = lxml.html.parse(url_to_site)
feeds = doc.xpath('//link[@type="application/rss+xml"]/@href') # list feed urls