From bc90c4c32657bd3267a1caa1c909af6435473642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=CC=88nder=20Ceylan?= Date: Wed, 8 Jun 2022 17:06:31 +0200 Subject: [PATCH] fix(puppets): update scraper for apple specs site --- src/config/constants.ts | 2 +- src/helpers/puppets.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/config/constants.ts b/src/config/constants.ts index 504e34f6..d935fd0e 100644 --- a/src/config/constants.ts +++ b/src/config/constants.ts @@ -174,7 +174,7 @@ export default { EMULATED_USER_AGENT: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3641.0 Safari/537.36', APPLE_HIG_SPLASH_SCR_SPECS_URL: - 'https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/adaptivity-and-layout/', + 'https://developer.apple.com/design/human-interface-guidelines/foundations/layout/', // Apple platform specs: https://developer.apple.com/design/human-interface-guidelines/ios/icons-and-images/app-icon/ // https://web.dev/apple-touch-icon/ diff --git a/src/helpers/puppets.ts b/src/helpers/puppets.ts index 7134e28a..85c46627 100644 --- a/src/helpers/puppets.ts +++ b/src/helpers/puppets.ts @@ -40,7 +40,11 @@ const getAppleSplashScreenData = async ( const splashScreenData = await page.evaluate(() => { const scrapeSplashScreenDataFromHIGPage = (): LaunchScreenSpec[] => { return Array.from( - document.querySelectorAll('table')?.[0].querySelectorAll('tbody tr'), + document + .querySelectorAll( + '#device-screen-sizes-and-orientations + table', + )?.[0] + .querySelectorAll('tbody tr'), ).map((tr) => { // https://regex101.com/r/4dwvYf/4 const dimensionRegex = /(\d+)x(\d+)\spt\s\((\d+)x(\d+)\spx\s@(\d)x\)/gm;