-
Notifications
You must be signed in to change notification settings - Fork 61
add a method on the Selector class, to export back the selector to css #75
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #75 +/- ##
==========================================
+ Coverage 95.02% 95.05% +0.03%
==========================================
Files 3 3
Lines 703 748 +45
Branches 114 124 +10
==========================================
+ Hits 668 711 +43
- Misses 20 21 +1
- Partials 15 16 +1
Continue to review full report at Codecov.
|
Hi @arthurdarcet , sorry for the delayed feedback. |
if selector.value is None: | ||
value = None | ||
elif self.lower_case_attribute_values: | ||
value = selector.value.value.lower() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this fixing a bug? I don't quite get this changing to selector.value.value
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's the symmetrical change for this: https://github.com/scrapy/cssselect/pull/75/files/08b0e472175197d4887612cd90d74815ab10d90a#diff-adc3ae8f2cf8b1931771d84ca7af6275R596
needed because i had to distinguish between different types of values here: https://github.com/scrapy/cssselect/pull/75/files/08b0e472175197d4887612cd90d74815ab10d90a#diff-adc3ae8f2cf8b1931771d84ca7af6275R651 (strings have to be serialised with quotes, number have to skip them, …)
I'm not sure I remember why I needed
Your call for the method name, you're right |
…ctors (otherwise edge ignores them)
08b0e47
to
8d0ff3e
Compare
Codecov Report
@@ Coverage Diff @@
## master #75 +/- ##
==========================================
+ Coverage 95.25% 95.57% +0.32%
==========================================
Files 2 2
Lines 695 746 +51
Branches 113 125 +12
==========================================
+ Hits 662 713 +51
Misses 19 19
Partials 14 14
Continue to review full report at Codecov.
|
@Gallaecio I think this could be useful and almost ready. Could you take a look? thanks |
It looks good to me. However, I wonder if, now that #87 has been merged, we need to take it into account here as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, :scope > *
works just fine.
Thanks @arthurdarcet! And thanks @redapple, @dangra and @Gallaecio for reviews. |
My use case is the following:
I have added a
css
method on theSelector
class (and on each "sub"-selectors), to be able to export them back to CSS