APIs & web scraping Flashcards
1
Q
Using BeautifulSoup, how to capture all ‘a’ tags?
A
a_tag_text = soup.find_all(‘a’)
2
Q
Using BeautifulSoup, how to get the link URL out of captured ‘a’ tag text?
A
a_tag_text.get(‘href’)
3
Q
Using BeautifulSoup, how to get the link TEXT out of captured ‘a’ tag text?
A
a_tag_text.text