from bs4 import BeautifulSoup
import requests

url = "https://en.wikipedia.org/wiki/List_of_Scottish_monarchs"
page = requests.get(url)
soup = BeautifulSoup(page.text, 'html.parser')

# get the first table in the article
table = soup.find( 'table', class_='wikitable' )

# get a list of all rows in that table
rows = table.find_all('tr')

# loop over all rows, get all cells
for row in rows:
    try:
        cells = row.find_all('td')
        # print contents of the first cell in the row
        print( cells[0].text )
    except:
        pass

b40fb5dc9fb2c5c8b4ae647f119d2c39e06bfc42
<mask token>

<mask token>
for row in rows:
    try:
        cells = row.find_all('td')
        print(cells[0].text)
    except:
        pass

<mask token>
url = 'https://en.wikipedia.org/wiki/List_of_Scottish_monarchs'
page = requests.get(url)
soup = BeautifulSoup(page.text, 'html.parser')
table = soup.find('table', class_='wikitable')
rows = table.find_all('tr')
for row in rows:
    try:
        cells = row.find_all('td')
        print(cells[0].text)
    except:
        pass

from bs4 import BeautifulSoup
import requests
url = 'https://en.wikipedia.org/wiki/List_of_Scottish_monarchs'
page = requests.get(url)
soup = BeautifulSoup(page.text, 'html.parser')
table = soup.find('table', class_='wikitable')
rows = table.find_all('tr')
for row in rows:
    try:
        cells = row.find_all('td')
        print(cells[0].text)
    except:
        pass

from bs4 import BeautifulSoup
import requests

url = "https://en.wikipedia.org/wiki/List_of_Scottish_monarchs"
page = requests.get(url)
soup = BeautifulSoup(page.text, 'html.parser')

# get the first table in the article
table = soup.find( 'table', class_='wikitable' )

# get a list of all rows in that table
rows = table.find_all('tr')

# loop over all rows, get all cells
for row in rows:
    try:
        cells = row.find_all('td')
        # print contents of the first cell in the row
        print( cells[0].text )
    except:
        pass
