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

[MRG+1] Add a css2xpath util function available at the top-level #64

Merged
merged 1 commit into from
Nov 14, 2016

Conversation

eliasdorneles
Copy link
Member

I've found useful a small util function to get a CSS query translated to XPath, for cases when I'm using an API that only accepts XPath but I want to use CSS at least for parts of an expression.

Here are some usage examples from recent code that might illustrate the usefulness:

  • css2xpath('.profileTopData') + '//h3
  • next_page_xpath = css2xpath('.paginationBar a') + '[./span[contains(@Class, "next")]]/@href'

Does this look good to you?

@codecov-io
Copy link

codecov-io commented Nov 14, 2016

Current coverage is 100% (diff: 100%)

Merging #64 into master will not change coverage

@@           master   #64   diff @@
===================================
  Files           4     4          
  Lines         196   200     +4   
  Methods         0     0          
  Messages        0     0          
  Branches       34    34          
===================================
+ Hits          196   200     +4   
  Misses          0     0          
  Partials        0     0          

Powered by Codecov. Last update 4434921...27f00ea

@redapple redapple changed the title Add a css2xpath util function available at the top-level [MRG+1] Add a css2xpath util function available at the top-level Nov 14, 2016
@kmike kmike merged commit 8aa8a48 into master Nov 14, 2016
@kmike kmike deleted the add-css2xpath branch November 18, 2016 15:27
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.

None yet

4 participants