Skip to content

Commit

Permalink
fix: change chromium to webkit
Browse files Browse the repository at this point in the history
  • Loading branch information
orkr3426 committed Feb 6, 2025
1 parent b941f5c commit c1cc763
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/agents/scrapers/university_of_british_columbia.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async def fetch_courses(self) -> CourseListingModel:
window = 4

async with async_playwright() as p:
browser = await p.chromium.launch()
browser = await p.webkit.launch()
page = await browser.new_page()
await page.set_viewport_size({
"width": 500,
Expand All @@ -113,6 +113,7 @@ async def fetch_courses(self) -> CourseListingModel:

# for i in range(remainder):
# self.fetch_courses_e(page=page, pageNum=i+(window * itr))
await page.close()
await browser.close()

year = datetime.now().year
Expand Down Expand Up @@ -149,7 +150,7 @@ async def fetch_courses_e(self, page, pageNum) -> CourseListingModel:

# parse each html page into json using self.llm_html_parser
async with async_playwright() as p2:
browser = await p2.chromium.launch()
browser = await p2.webkit.launch()
page = await browser.new_page()
await page.set_viewport_size({
"width": 500,
Expand All @@ -158,7 +159,7 @@ async def fetch_courses_e(self, page, pageNum) -> CourseListingModel:

page.set_default_timeout = 60000
page.set_default_navigation_timeout = 60000

await page.goto(self.base_url)
await self.setupPage(page, pageNum)

Expand Down Expand Up @@ -302,7 +303,8 @@ async def fetch_courses_e(self, page, pageNum) -> CourseListingModel:
if pageNumber[0] == pageNumber[2]:
stop = True
courseName = await (await page.query_selector('.l-node__title')).inner_text()


await page.close()
await browser.close()

# return data in foramt of models/course.py
Expand Down

0 comments on commit c1cc763

Please sign in to comment.