diff --git a/nba_data/models.py b/nba_data/models.py index 71a8362..b096caa 100644 --- a/nba_data/models.py +++ b/nba_data/models.py @@ -1,3 +1,4 @@ from django.db import models # Create your models here. + diff --git a/nba_data/scraper.py b/nba_data/scraper.py index f34d1f5..00a9d14 100644 --- a/nba_data/scraper.py +++ b/nba_data/scraper.py @@ -4,10 +4,16 @@ import csv import json import os + +team = input('What team? ') +season = input('What season? ') + +url_make = 'https://www.basketball-reference.com/teams/' + team + '/' + season + '.html' + url = 'https://www.basketball-reference.com/teams/HOU/2018.html' lakers = 'https://www.basketball-reference.com/teams/LAL/2020.html' -response = requests.get(url) +response = requests.get(url_make) soup = BeautifulSoup(response.text, "html.parser") @@ -45,4 +51,7 @@ with open(csv_output_path, "w", newline="") as csvfile: json_output_path = os.path.join(script_dir, '..', 'data', 'output.json') with open(json_output_path, 'w') as jsonfile: - json.dump(data, jsonfile) \ No newline at end of file + json.dump(data, jsonfile) + + +print('success') \ No newline at end of file