我想从网页中提取所有 URL,如何使用 nokogiri 来做到这一点?
例子:
<div class="热"> <a href='http://example.org/site/1/'>站点 1</a> <a href='http://example.org/site/2/'>站点 2</a> <a href='http://example.org/site/3/'>站点 3</a> </div>
结果应该是一个列表:
l = ['http://example.org/site/1/', 'http://example.org/site/2/', 'http://example.org/site/3/'