Skip to content

fix: specify h3 and span selectors for groups search extraction (#593)#603

Merged
sigvardt merged 1 commit intomainfrom
ai/issue-593-bug-search-groups-category-over-extracts-name-and-
Mar 21, 2026
Merged

fix: specify h3 and span selectors for groups search extraction (#593)#603
sigvardt merged 1 commit intomainfrom
ai/issue-593-bug-search-groups-category-over-extracts-name-and-

Conversation

@sigvardt
Copy link
Owner

Summary

Resolves #593

The scraper for group search was extracting the entire text block of the search result card for the name and member_count properties. This was because it fell back to .innerText on the card or textContent on the app-aware-link which often wraps the entire group search result card in LinkedIn's modern UI.

This PR fixes this behavior by targeting specific h3 and span selectors that explicitly contain the name and member count before falling back to less precise methods.

Changes

  • Modified legacyCards group search extractor to first attempt specific h3 and span selectors for name.
  • Modified legacyCards group search extractor to attempt specific span elements for member count before falling back.
  • Updated extractAiCards and the general list fallback logic to also prioritize explicit .querySelectorAll("span") and h3 tags.

Validation

  • Ran the existing groups.e2e.test.ts to ensure searchGroups output remains intact.
  • Ran tsc -b packages/core successfully to ensure type safety.
  • Lint passed cleanly.

Closes #593

This resolves an issue where the search results scraper was targeting the `innerText` or `textContent` of the whole card wrapper for group names and member counts, resulting in over-extracted fields.
@sigvardt sigvardt enabled auto-merge (squash) March 21, 2026 18:50
@sigvardt sigvardt merged commit 15aab18 into main Mar 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: search groups category over-extracts name and member_count

1 participant