[feature-request] `:not()` to support generic selectors (not only "simple" ones)
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Tái hiện lỗi với cssselect.parse('a:not(p>a)'). Bắt đầu trong cssselect/parser.py tại parse, parse_selector_group và parse_simple_selector, là những thành phần xuất hiện trong traceback. Hoàn thành khi dạng bộ chọn generic được yêu cầu được :not() chấp nhận mà không có lỗi cú pháp như đã nêu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The document (version 0.9.1) says:
:not()accepts a sequence of simple selectors, not just single simple selector. For example,:not(a.important[rel])is allowed, even though the negation contains 3 simple selectors.
May I ask what is a simple selector? Can :not() support something like :not(a>b)?
>>> import cssselect
>>> cssselect.parse('a:not(p>a)')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.4/site-packages/cssselect/parser.py", line 355, in parse
return list(parse_selector_group(stream))
File "/usr/lib/python3.4/site-packages/cssselect/parser.py", line 370, in parse_selector_group
yield Selector(*parse_selector(stream))
File "/usr/lib/python3.4/site-packages/cssselect/parser.py", line 378, in parse_selector
result, pseudo_element = parse_simple_selector(stream)
File "/usr/lib/python3.4/site-packages/cssselect/parser.py", line 471, in parse_simple_selector
raise SelectorSyntaxError("Expected ')', got %s" % (next,))
cssselect.parser.SelectorSyntaxError: Expected ')', got <DELIM '>' at 7>
- Ngôn ngữ chính
- Python
- Star
- 311
- Fork
- 73
- Merge trung bình
- 17 giờ 34 phút
- Pull request đã merge (30 ngày)
- 18
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 scrapy/cssselect
-
Add comprehensive developer docsCó thể đã có người làm @AdrianAtZyte đã nhận 66 ngày trước. Đang mởdocumentation enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
Maintainer thường phản hồi trong vòng 1 ngày
-
The parsing of :where and :is is not spec compliantCó thể đã có người làm @AdrianAtZyte đã nhận 80 ngày trước. Đang mởCSS Selectors Level 4 enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
scrapy/cssselect#135 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Support :nth-child(An+B of S)Có thể đã có người làm @annbgn đã nhận 1931 ngày trước. Đang mởCSS Selectors Level 4
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
scrapy/cssselect#76 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của scrapy/cssselect
Issue tương tự
-
Link Checker ReportĐang mởautomated issue linkchecker report
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
QuantEcon/lecture-python.myst#1098 ·
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 82/100
-
[Bug]: Processing errors missing from Docker logs due to incorrect console-handler detectionĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
podly-pure-podcasts/podly_pure_podcasts#279 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
New template proposal: ljpĐang mởtemplate-proposal
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
OpenShot/openshot-qt#6230 ·
Maintainer thường phản hồi trong vòng 1 ngày