python BeautiulSoup
==============================================查找网页中<a>标签中的链接
from bs4 import BeautifulSoup
with open('beautifulSoup_test.html','r',encoding='utf-8')as f: #beautifulSoup_test.html是同级网页源代码
bs=BeautifulSoup(f.read())
a_lst=bs.find_all('a')
for a in a_lst:
if a.text!='':
print(a.text.strip(),a['href'])
一个二次元的生物