Finding a specific element from a website using beautiful soup in Python

Try this:

from bs4 import BeautifulSoup
import urllib.request
import pandas as pd

url = 'https://english.tgju.org/'
page = urllib.request.urlopen(url)
soup = BeautifulSoup(page.read(), 'html.parser')

rank = soup.find('tr', {'data-market-row':'sana_sell_usd'})['data-price']
print(rank)

Output:

270,639

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top