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

Attribute Contains (*=) not working #36

Closed
fgblomqvist opened this Issue Jun 7, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@fgblomqvist

fgblomqvist commented Jun 7, 2018

I am only able to get the attribute contains selector to work for some arbitrary values, not constantly. However, if I switch to the regex selector, it always works like expected.

E.g. this works:
[id#=-621-] but not this [id*=-621-]
I have tried with smaller portions of that text with the same result. Am I misunderstanding the substring selector? I would think that the above selectors should yield the same result. I'm using goquery, so not directly using cascadia.

The id that I am matching against is: eventLineBook-3139607-238-621-2

@andybalholm

This comment has been minimized.

Owner

andybalholm commented Jun 7, 2018

You need to put quotes around the value ([id*="-621-"]). The part after the equal sign can be either an identifier or a quoted string.

@fgblomqvist

This comment has been minimized.

fgblomqvist commented Jun 7, 2018

Ah I see, now it works. Tried single quotes (like in jQuery) but didn't work. Didn't try double quotes until now. Thanks!

@fgblomqvist fgblomqvist closed this Jun 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment