soup = BeautifulSoup(html,"html.parser") html=soup.select("table a") for k in html: print(k.string) print(k['href'])