BeautifulSoup的find和find_all是搜索html的tag,返回是整个tag
find可以连用,相当于在父tag里面find 子tag,在子tag里面find孙tag
def bs_scraper(html):
soup = BeautifulSoup(html, 'html.parser')
results = {}
for target in targets:
results[target] = soup.find('table').find('tr', id='places_%s__row' % target) \
.find('td', class_="w2p_fw").text
return results
标签层级为table-->tr-->td