html = '''
<tr bgcolor="#CCCCCC">
<td colspan="2"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><span class="txt_arial_8pt_black">1º
Período Ideal</span></font></td>
<td><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><span class="txt_arial_8pt_black">Créd.<br/>
Aula</span></font></td>
<td><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><span class="txt_arial_8pt_black">Créd.<br/>
Trab.</span></font></td>
<td align="center"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><span class="txt_arial_8pt_black">CH</span></font></td>
<td align="center" width="6%"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><span class="txt_arial_8pt_black">CE</span></font></td>
<td align="center" width="6%"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><span class="txt_arial_8pt_black">CP</span></font></td>
<td align="center" width="6%"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><span class="txt_arial_8pt_black">ATPA</span></font></td>
</tr>'''
from bs4 import BeautifulSoup
soup = BeautifulSoup(html, 'html.parser')
for span in soup.find_all('span', class_='txt_arial_8pt_black'):
print(span.text)
html = '''
<tr bgcolor="#CCCCCC">
<td colspan="2"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><span class="txt_arial_8pt_black">1º
Período Ideal</span></font></td>
<td><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><span class="txt_arial_8pt_black">Créd.<br/>
Aula</span></font></td>
<td><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><span class="txt_arial_8pt_black">Créd.<br/>
Trab.</span></font></td>
<td align="center"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><span class="txt_arial_8pt_black">CH</span></font></td>
<td align="center" width="6%"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><span class="txt_arial_8pt_black">CE</span></font></td>
<td align="center" width="6%"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><span class="txt_arial_8pt_black">CP</span></font></td>
<td align="center" width="6%"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1"><span class="txt_arial_8pt_black">ATPA</span></font></td>
</tr>'''
from bs4 import BeautifulSoup
soup = BeautifulSoup(html, 'html.parser')
for span in soup.find_all('span', class_='txt_arial_8pt_black'):
print(span.text)
soup = BeautifulSoup(html, 'html5lib')
soup = BeautifulSoup(html, 'html5lib')
import re
for texto in re.findall(r'<span class="txt_arial_8pt_black">(.*?)</span>', html, re.DOTALL):
print(texto)
import re
for texto in re.findall(r'<span class="txt_arial_8pt_black">(.*?)</span>', html, re.DOTALL):
print(texto)
r'<span[^>]+class="[^"]*\btxt_arial_8pt_black\b[^"]*"[^>]*>(.*?)</span>'
r'<span[^>]+class="[^"]*\btxt_arial_8pt_black\b[^"]*"[^>]*>(.*?)</span>'
r'<span[^>]+class="[^"]*\btxt_arial_8pt_black\b[^"]*"[^>]*>(.*?)</span>(?![^<>]*</span>)'
r'<span[^>]+class="[^"]*\btxt_arial_8pt_black\b[^"]*"[^>]*>(.*?)</span>(?![^<>]*</span>)'
r'<span[^>]+class="[^"]*\btxt_arial_8pt_black\b[^"]*"[^>]*>(.*?)</span>(?!(?:</?(?!\bspan\b)[^<>]*>|[^<>])*</span>)'
r'<span[^>]+class="[^"]*\btxt_arial_8pt_black\b[^"]*"[^>]*>(.*?)</span>(?!(?:</?(?!\bspan\b)[^<>]*>|[^<>])*</span>)'