<td class="user-info">
<div class="id" title="Player ID">1211</div>
<div class="name" title="PName">Ronaldo</div>
</td>
I wanted to scrape the 1211 in "Player ID" but couldn't. Here is my code so far:
adressyr = urllib2.urlopen("WEBSITE")
soup = BeautifulSoup(adressyr, 'html.parser')
mydivs = soup.findAll("td", { "class" : "Player ID" })
print mydivs
what am I doing wrong?
The class of that div is not Player ID
but id
. Try:
adressyr = urllib2.urlopen("WEBSITE")
soup = BeautifulSoup(adressyr, 'html.parser')
mydivs = soup.findAll("td", { "class" : "id" })
print mydivs
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.