Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support elements that only contain textContent, remove commas from the end of addresses #1440

Merged
merged 4 commits into from
Jan 30, 2025

Conversation

brianhall
Copy link
Contributor

@brianhall brianhall commented Jan 29, 2025

Asana Task/Github Issue:

Description

When using XPath’s text() node test (e.g. //strong[contains(text(), 'Locations:')]/following-sibling::text()), a node is returned that only contains textContent, not innerText.

This change updates the extractor to check for innerText, and fallback to textContent. Also included, a small change to strip out commas at the end of addresses.

Testing Steps

  • Run integration / unit tests
  • Drag this version of C-S-S into XCode and run PIR.

Checklist

Please tick all that apply:

  • I have tested this change locally
  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged

Copy link

netlify bot commented Jan 29, 2025

Deploy Preview for content-scope-scripts ready!

Name Link
🔨 Latest commit a314aa2
🔍 Latest deploy log https://app.netlify.com/sites/content-scope-scripts/deploys/679b45bcd4b61c0008632ed7
😎 Deploy Preview https://deploy-preview-1440--content-scope-scripts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

github-actions bot commented Jan 29, 2025

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

Copy link

github-actions bot commented Jan 29, 2025

[Beta] Generated file diff

Time updated: Thu, 30 Jan 2025 09:29:04 GMT

Integration
    - integration/contentScope.js

File has changed

Windows
    - windows/contentScope.js

File has changed

Apple
    - dist/contentScopeIsolated.js

File has changed

@brianhall brianhall changed the title Support textNodes, remove commas from the end of addresses Support elements that only contain textContent, remove commas from the end of addresses Jan 30, 2025
@brianhall brianhall marked this pull request as ready for review January 30, 2025 09:28
@brianhall brianhall requested review from shakyShane and a team as code owners January 30, 2025 09:28
@brianhall brianhall merged commit a0325f6 into main Jan 30, 2025
23 checks passed
@brianhall brianhall deleted the bhall/improve-name-address-scraping branch January 30, 2025 10:08
mgurgel pushed a commit that referenced this pull request Feb 3, 2025
…e end of addresses (#1440)

* Support textNodes, remove commas from the end of addresses

* Restructure the textContent statement

* Make code more testable, add tests
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.

2 participants