soup = BeautifulSoup(page)
rows = soup.find_all('tr', {'class': re.compile('class1.*')})
for row in rows:
    cls = row.attrs.get('class')
if not ('class2' in cls or 'class3' in cls):
    pass
Выбор определенных тегов <tr> с помощью BeautifulSoup