Assume the following:
<td title="I want this title" role="gridcell"><a onclick="open" href="#">TEXT</a></td>
Now, I've successfully found respectively the table and individual rows using:
for rows in soup.find_all(['tr']):
for cells in rows.find_all(['td']):
By printing cells
I can see I've found the correct rows, but I'm really not sure how to take the title attribute and save it as a string? I've attempted to use temp = soup.find('td')['title']
, but I'm getting errors doing this, so evidently I'm doing something wrong.
Any suggestions would be much appreciated!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…