[Bug]: PathDepthScorer counts query and fragment slashes as path levels
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Bắt đầu với PathDepthScorer trong crawl4ai.deep_crawling.scorers và dùng cách tái hiện trong issue để so sánh /docs/guide với cùng đường dẫn có thêm hậu tố truy vấn và phân mảnh. Kiểm tra rằng dấu gạch chéo ở cuối các hậu tố không ảnh hưởng đến độ sâu đường dẫn, và một URL chỉ có authority cùng với một URL truy vấn không bị coi là có đường dẫn. Chạy các trường hợp hồi quy của scorer được mô tả trong issue; công việc hoàn tất khi các trường hợp hậu tố đạt yêu cầu, còn các trường hợp đối chứng đã nêu và thuật toán độ sâu hiện có vẫn không thay đổi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
crawl4ai version
0.9.5, current develop at 240d9cd050b26607355a3bcf977aa73660069590.
Expected Behavior
PathDepthScorer should measure the URL path. Adding query parameters or a fragment should not change the path-depth score, even when those suffixes contain slashes or another URL.
Current Behavior
The scorer locates the first slash after the scheme and counts the entire remaining string, including query/fragment text. With optimal_depth=2, /docs/guide scores 1.0 but /docs/guide?next=/a/b/c scores 0.25. An authority-only URL whose query contains another URL can also be scored as if it had a path. This changes the priority assigned to links during deep crawling.
Reproduction
from crawl4ai.deep_crawling.scorers import PathDepthScorer
scorer = PathDepthScorer(optimal_depth=2)
print(scorer.score("https://example.com/docs/guide"))
print(scorer.score("https://example.com/docs/guide?next=/a/b/c"))
# Expected: 1.0, 1.0. Actual: 1.0, 0.25.
The real public scorer reproduced seven failing regression cases and five passing controls on unmodified develop. Query-only, fragment-only, combined suffixes, and a query URL without a preceding path are affected. Root/path controls, encoded characters and repeated separators are covered.
Proposed Fix
Discard the literal query and fragment suffixes before the existing path lookup. Keep the current depth algorithm, weighting, statistics and caches. This is separate from #2405 (file-extension scoring) and the old queue-direction problem #1080/#1081.
Environment
Windows / Python 3.12.14. Pure local scorer calls, with the installed dependencies and actual current checkout import. No browser, external website, model or network request is needed for the reproduction.
AI assistance: Codex identified this during a source audit for contribution opportunities, ran the original-code reproduction and prepared the minimal repair. No human review is claimed.
- Ngôn ngữ chính
- Python
- Star
- 86.4k
- Fork
- 9k
- Merge trung bình
- 4 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 23
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của unclecode/crawl4ai
-
[Bug]: Text after an inline <link>, <meta>, <style> or <noscript> is dropped from cleaned_html and markdownCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở🐞 Bug 🩺 Needs Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
unclecode/crawl4ai#2416 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
🐞 Bug 🩺 Needs Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
unclecode/crawl4ai#2382 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
🐞 Bug 🩺 Needs Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
unclecode/crawl4ai#2381 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
[Bug]: CrawlerRunConfig.clone() drops fallback_fetch_function, so deep crawls never use itCó thể làm lại được @siva23367 đã nhận 9 ngày trước và không có pull request nào đang mở. Đang mở⚙ Done 🐞 Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
unclecode/crawl4ai#2379 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
[Bug]: Docker memory guard reads host RAM when no container limit is set — cgroup v2 "max" defeats get_container_memory_percentCó thể đã có người làm @Battleplus đã nhận 65 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
unclecode/crawl4ai#2123 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của unclecode/crawl4ai
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
btclib-org/btclib-ecc#404 ·
-
changelog investigate
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
ramnes/notion-sdk-py#430 ·
-
bug good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
hyeonjoong/debussy#56 ·
-
README устарел: статус проекта, версия 0.1.0 при описании тега v0.1.1, семантика фолбэка поискаĐang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Lagrunge82/yandex-mail-mcp#43 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
liberation-data/drivine-python#252 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày