Skip to content

Commit 674d67f

Browse files
committed
Refactor run_scraper function to accept base_dir parameter for improved directory management
1 parent 45f463d commit 674d67f

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/excel_scraper/scraper.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,13 @@ async def scrape_data(self):
530530

531531

532532

533-
def run_scraper():
533+
def run_scraper(base_dir=None):
534534
import asyncio
535-
from .main import main
536-
asyncio.run(main())
535+
from .scraper import NYCInfoHubScraper
536+
537+
if base_dir is None:
538+
base_dir = os.getcwd()
539+
540+
scraper = NYCInfoHubScraper(base_dir=base_dir)
541+
asyncio.run(scraper.scrape_data())
542+

0 commit comments

Comments
 (0)