How about something like this? ```python import os import pandas as pd from selenium import webdriver os.chdir(r"C:\Users\harsh\Google Drive\sportsintel.shop\Files") cwd = os.getcwd() print(cwd) browser = webdriver.Chrome() class GameData: def __init__(self): self.dates = [] self.games = [] self.scores = [] self.home_odds = [] self.draw_odds = [] self.away_odds = [] def parse_data(url): browser.get(url) df = pd.read_html(browser.page_source, header=0)[0] game_data = GameData() game_date = None for row in df.itertuples(): if not isinstance(row[1], str): continue elif ':' not in row[1]: game_date = row[1].split('-')[0] continue game_data.dates.append(game_date) game_data.games.append(row[2]) game_data.scores.append(row[3]) game_data.home_odds.append(row[4]) game_data.draw_odds.append(row[5]) game_data.away_odds.append(row[6]) return game_data if __name__ == '__main__': urls = ["https://www.oddsportal.com/soccer/england/premier-league/results/", "https://www.oddsportal.com/soccer/england/premier-league/results/#/page/2/"] results = None for url in urls: game_data = parse_data(url) result = pd.DataFrame(game_data.__dict__) if not results: results = result else: results = results.append(result, ignore_index=True) ``` The class, although not needed, groups everything and keeps it clean. Plus if you ever have to use this data in other methods you don't have to have 6 args. As your code gets more sophisticated you can decouple the parsing logic so you could use the same grouping code for multiple sites.