0

I am new to using BeautifulSoup for web scraping and ran into the following issue: I am trying to scrape posts from a forum and I want to extract the posts' tags. Here is the HTML code of the tag class:

<a class="tag_css_link" href="XXXX" title="">Advanced Physics</a>

This format is consistent throughout the form. I tried using soup["title"] which gives me "". How can I extract "Advanced Physics"?

Whazzup
  • 175
  • 2
  • 12
  • 1
    Do you get answer from https://stackoverflow.com/questions/11716380/beautifulsoup-extract-text-from-anchor-tag? – ipramusinto Jun 08 '21 at 22:15

1 Answers1

1
soup.find("a", class_='tag_css_link').text

enter image description here

yf879
  • 168
  • 1
  • 7