fix: css_selector for raw://, ~ sibling combinator, background image extraction (#1484, #1254, #1691)#1826
Closed
hafezparast wants to merge 1 commit intounclecode:developfrom
Conversation
…extraction (unclecode#1484, unclecode#1254, unclecode#1691) - unclecode#1484: css_selector param in _scrap() was accepted but never applied for raw:// URLs. Now filters content before target_elements processing. - unclecode#1254: _resolve_source() only supported + (adjacent sibling). Added ~ (general sibling) combinator across all 5 extraction strategy implementations. - unclecode#1691: Image extraction only processed <img> tags. Now also extracts CSS background-image URLs and data-* attributes with image extensions on non-img elements (Elementor, page builders). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Mar 12, 2026
Collaborator
|
@hafezparast , thank you for your contribution. Here are some notes: Please update the PR to only address a fix for issue #1484 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
css_selectordoesn't work Buttarget_elementsdoes! #1484 —css_selectorwas ignored in_scrap()forraw://URLs_resolve_source()now supports~(general sibling) combinator alongside+background-imageURLs anddata-*attributes with image extensionsChanges
crawl4ai/content_scraping_strategy.py: Addedcss_selectorfiltering in_scrap()beforetarget_elementsprocessing; added background image extraction fromstyleattributes anddata-*attributes on non-<img>elementscrawl4ai/extraction_strategy.py: Updated all 5_resolve_source()implementations to accept~general sibling combinator; updated abstract method docstringTest plan
tests/test_issue_1484_css_selector.py(10 tests)tests/test_issue_1254_sibling_selectors.py(10 tests)tests/test_issue_1691_background_images.py(11 tests)Generated with Claude Code