Giter Club home page Giter Club logo

cssify's People

Contributors

dependabot[bot] avatar palfrey avatar santiycr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cssify's Issues

custom html elements with "-" dash, not translated properly

//sgswidget//a[contains(@href,'dashboard/profile')]

is translated proprely: 'sgswidget a[href*=dashboard/profile]'

current behaviour:

just add a dash to sgswidget
//sgs-widget//a[contains(@href,'dashboard/profile')]

and you will get the error:

cssify.cssify.XpathException: Invalid or unsupported Xpath: //sgs-widget//a[contains(@href,'dashboard/profile')]

expected condition:

//sgs-widget//a[contains(@href,'dashboard/profile')]

should be traslated properly to:

'sgs-widget a[href*=dashboard/profile]'

License

Hi @santiycr,

What is the license for this project?
Can I use and rewrite this code in my open source project if I cite you as an original author?

translation inconsistency: no quote in attribute selector

a = "//a[contains(@href,'attestation-upload')]"
cssify(a)

output:

a[href*=attestation-upload]

expected condition:

in this case proper css selector, or the more accurate selector would be one with quoted value:

a[href*='attestation-upload']

I believe there should be an elegant way to make it happen

Some ideas about the script

:contains pseudo-class is very incompatible with browsers (also deprecated in CSS3) so I've removed it from the script but some more xpathes can be safely converted. See my port for example.

Support index more than 9

Sup! Thank you for lib, but now we can't use it cause of bug with indexes. When I put xpath with index more than 9:

cssify("/li[10]")
# cssify.cssify.XpathException: Invalid or unsupported Xpath: /li[10]

Expected behaviour is:

cssify("/li[10]")
# 'li:nth-of-type(10)'

Problem with "nth" selector

Hello,

I've got some problem with your translator when it translates something like "table[3]" into "table:nth(3)".
Could you modify your source to change the keyword "nth" to "nth-of-type" ?

Thank you for your support,
Pierre-François Bonnefoi.

Support for custom html tags

I am using cssify and ran into a problem with some rather unusual html elements, which the package doesn't not (yet) recognise. And I was wondering if this could be implemented.

For example when you visit this webpage in incognito, you'll get a cookie notice for which you can see an html element:
<wsp-consent-modal class="consent-modal" consent-choices="third-party-cookies,crm,browse-data" consent-version="5"> ...... </wsp-consent-modal>

Thanks in advance for any help!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.