Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OR condition in CSS selector

Tags:

I'm trying to find a element by a css selector. I have a script which I'm using on multiple sites, and there is the same element, but with different classes. Is there any way to find by something like that:

css=div[(id='resultVersionA']||[id='resultVersionB')] 

Best regards

EDIT

Your solutions works, but not for my next elements

#first-order price, #first price input[type='submit'] 

To be more clear: In upon query I want to select button which is under div which is i 'first_order price' OR 'first price'.

like image 475
user278618 Avatar asked Jan 20 '11 14:01

user278618


1 Answers

Update

This should do it (sorry I didn't see your edit before):

#first-order price input[type='submit'], #first price input[type='submit'] 

Old answer, don't use

If you are searching for IDs,

div#resultVersionA, div#resultVersionB 

If you are searching for classes,

div.resultVersionA, div.resultVersionB 

No need for attribute selectors. If you don't care about element type you can also omit the div parts.

like image 55
BoltClock Avatar answered Sep 25 '22 01:09

BoltClock