Home > Enterprise >  Is it possible to scrape HTML hyperlink text, rather than just the URL?
Is it possible to scrape HTML hyperlink text, rather than just the URL?

Time:01-06

Im trying to scrape some text from :https://twitchtracker.com/criticalrole/games, in order to show a streamers most streamed game for a twitch pay data analysis project.

I am trying to scrape "Dungeons & Dragons" from the first row in the table, but so far Ive only scraped the href.

My Code: table = soup2.find(id='games').select('a', limit=1) print(table)

Output [<a href="/criticalrole/games/509577"> Dungeons &amp; Dragons </a>]

CodePudding user response:

Use get_text():

print(table[0].get_text())
  •  Tags:  
  • Related