beautifulsoup 4 使用
官方文档
https://beautifulsoup.readthedocs.io/zh_CN/v4.4.0/
使用case:
soup.find_all('a') # [<a class="sister" href="http://example.com/elsie" id="link1">Elsie</a>, # <a class="sister" href="http://example.com/lacie" id="link2">Lacie</a>, # <a class="sister" href="http://example.com/tillie" id="link3">Tillie</a>]
从文档中找到所有<a>标签的链接:
for link in soup.find_all('a'): print(link.get('href')) # http://example.com/elsie # http://example.com/lacie # http://example.com/tillie
doing

浙公网安备 33010602011771号