Update api_scraper.py
Browse files- api_scraper.py +2 -0
api_scraper.py
CHANGED
|
@@ -6,6 +6,7 @@ from tqdm import tqdm
|
|
| 6 |
from pytz import timezone
|
| 7 |
import re
|
| 8 |
from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
class MLB_Scrape:
|
|
@@ -160,6 +161,7 @@ class MLB_Scrape:
|
|
| 160 |
futures = {executor.submit(fetch_data, game_id): game_id for game_id in game_list_input}
|
| 161 |
for future in tqdm(as_completed(futures), total=len(futures), desc="Processing", unit="iteration"):
|
| 162 |
data_total.append(future.result())
|
|
|
|
| 163 |
|
| 164 |
return data_total
|
| 165 |
|
|
|
|
| 6 |
from pytz import timezone
|
| 7 |
import re
|
| 8 |
from concurrent.futures import ThreadPoolExecutor, as_completed
|
| 9 |
+
import time
|
| 10 |
|
| 11 |
|
| 12 |
class MLB_Scrape:
|
|
|
|
| 161 |
futures = {executor.submit(fetch_data, game_id): game_id for game_id in game_list_input}
|
| 162 |
for future in tqdm(as_completed(futures), total=len(futures), desc="Processing", unit="iteration"):
|
| 163 |
data_total.append(future.result())
|
| 164 |
+
time.sleep(0.1)
|
| 165 |
|
| 166 |
return data_total
|
| 167 |
|