0

Basically, the question is how to convert and and not operators correctly in the given xpath:

"//div[contains(@class, 'cpthead') or contains(@class, 'cptbulkhead') and (not(contains(@class, 'overloaded') or contains(@class, 'loaded')))]"

the answer is :

 .cpthead:not(.overloaded):not(.loaded),cptbulkhead:not(.overloaded):not(.loaded)
1
  • Please do not edit the question with the answer. You have already accepted an answer correctly, as described in the help, so if you have more to add then please comment (if you can) on that answer, or answer and accept the question yourself. Commented Feb 4, 2016 at 8:57

2 Answers 2

1

For the or you can use a comma, like this:

div.cpthead.cptbulkhead.loaded:not(.overloaded),
div.cpthead.cpthead.loaded:not(.overloaded)

PS: It's a reply of har07's answer but I can't post comments...

Sign up to request clarification or add additional context in comments.

Comments

0

You can concatenate multiple class selectors in CSS to translate your XPath and, and then use pseudo-class :not() to translate XPath not(), something like this :

div.cpthead.cptbulkhead.loaded:not(.overloaded)

1 Comment

And what about the "or"?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.