santiycr / cssify

XPATH to CSS translator
MIT License
132 stars 46 forks source link

translation inconsistency: no quote in attribute selector #13

Open justnpT opened 3 years ago

justnpT commented 3 years ago

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

DallanQ commented 5 months ago

Related problem: //a[@href='/browse/boardgame'] is translated to a[href=/browse/boardgame] (without quotes) which BeautifulSoup says is an invalid selector. Adding quotes a[href='/browse/boardgame'] makes BeautifulSoup happy.