Skip to content

Commit

Permalink
Small fix for Instagram posts with no date span
Browse files Browse the repository at this point in the history
  • Loading branch information
aug-dev committed May 12, 2024
1 parent 1be863c commit a72c02b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/scripts/search-engines/google-desktop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,11 @@ const desktopSerpHandlers: Record<string, SerpHandler> = {
const textContainer = entryRoot.querySelector<HTMLElement>(
[
".rn876d.LLotyc",
'div[class="HDMle"]',
".HDMle",
".g4Fgt",
".lt6hVb",
".p8o1rd",
".iUuXb",
".xH3xue:last-of-type",
".WpsIbd",
".FNMYpd",
].join(", "),
Expand All @@ -331,7 +330,11 @@ const desktopSerpHandlers: Record<string, SerpHandler> = {
dateContainer = null;
}

return emptySlot ?? dateContainer ?? textContainer;
const nestedSpan = dateContainer?.querySelector<HTMLElement>(
".xH3xue:last-of-type",
);

return emptySlot ?? nestedSpan ?? dateContainer ?? textContainer;
}
return null;
},
Expand Down

0 comments on commit a72c02b

Please sign in to comment.