soup = BeautifulSoup(html_doc)
spans = soup.find_all('span', {'class': 'blue'})
lines = [span.get_text() for span in spans]
How to find spans with a specific class containing specific text using beautiful soup and re?