Skip to content

Commit

Permalink
Wait longer for BFI show pages to load to make sure data is available
Browse files Browse the repository at this point in the history
  • Loading branch information
alistairjcbrown committed Nov 2, 2024
1 parent 079e9b3 commit eef8c3d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions common/bfi.org.uk/retrieve.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ async function processSearchResultPage(
`${domain}${showUrl}`,
cacheKey,
async (page) => {
await page.waitForLoadState("domcontentloaded");
await page.getByRole("heading", { level: 1 }).waitFor();
// Wait until the page is finished everything
await page.waitForLoadState("networkidle");
// Make sure there's information showing. Not all pages have film info
// (that we care about), so check for the rich text or media areas too
await page
.locator(".Film-info__information,.Rich-text,.Media")
.waitFor({ strict: false });

return await page.content();
},
);
Expand Down

0 comments on commit eef8c3d

Please sign in to comment.