Reputation: 62
allId=soup.find_all("tr","data-id")
I just take data-id's values. How can I scrape these tags?
Upvotes: 1
Views: 446
Reputation: 33384
To fetch value of data-id try this.
allId=soup.find_all("tr",attrs={"data-id" : True})
for item in allId:
print(item['data-id'])
You can also use css selector.
allId=soup.select("tr[data-id]")
for item in allId:
print(item['data-id'])
Upvotes: 1