考虑如下字符串:
string = "<p>Hello World</p><a href="http://example.com">More Examples</a><a href="http://example2.com">Even More Examples</a>"
Run Code Online (Sandbox Code Playgroud)
我怎么能用Python在锚标记的href中提取网址?就像是:
>>> url = getURLs(string)
>>> url
['http://example.com', 'http://example2.com']
Run Code Online (Sandbox Code Playgroud)
谢谢!