text_html_output_1.png
from bs4 import BeautifulSoup

import pandas as pd

import requests

titles = []
years = []
urls = []
ranks = [i for i in range(1, 1001)]

def JazzStandardsTable(url):
    r = requests.get(url)
    soup = BeautifulSoup(r.content, 'html.parser')
    for i in range(25, 125):
        titles.append(soup.find_all('a')[i].get_text())
    for i in range(25, 125):
        urls.append(soup.find_all('a')[i].get('href'))
    for i in range(0, 100):
        years.append(soup.find_all('tr', class_='JSContentsLine')[i].get_text().split('\xa0')[0][-4:])

url = 'https://www.jazzstandards.com/compositions/index.htm'
JazzStandardsTable(url)
for i in range(2, 11):
    index = url.find('index')
    url = url[:index + 5] + str(i) + '.htm'
    JazzStandardsTable(url)

title = pd.Series(titles, name='Title')
year = pd.Series(years, name='Year')
rank = pd.Series(ranks, name='Rank')
url = pd.Series(urls, name='URL')

JazzStandards = pd.concat([rank, title, year, url], axis=1)

JazzStandards