r1 = requests.get(firsturl)
soup1 = BeautifulSoup(r1.content, "lxml")
table = soup1.select('div#my-players-table table')[0]
row = table.find('td', align='left', text = re.compile('Patriots'))
for cell in row.find_next_siblings('td'):
print(cell.text)
错误发生在row = table.find中,它表示text = re.compile
无效,因为re
是未解析的引用。
我该如何解决这个问题?