Skip to content

Commit

Permalink
fix(puppets): update scraper for apple specs site
Browse files Browse the repository at this point in the history
  • Loading branch information
onderceylan committed Jun 8, 2022
1 parent 95aa288 commit bc90c4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
6 changes: 5 additions & 1 deletion src/helpers/puppets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bc90c4c

Please sign in to comment.