I don't have much knowledge about javascript, but you can still refer to the example below for guidance:
If you want to find multiple elements with similar attributes, you can use the following code:
twoButtons = locate_elements_by_css_selector("button[class='btn bid-hotel-btn']")
If the class attribute is not unique, you can combine other attributes to make it more specific. For example:
twoButtons = locate_elements_by_css_selector("button[class='btn bid-hotel-btn'][type='button']")
The variable twoButtons will contain two web elements representing the buttons you intend to click on.
You can then interact with each button in the twoButtons list like so:
twoButtons[0].click() // Click the first button
twoButtons[1].click() // Click the second button
When I mention "first
" and "second
" above, I am referring to the order in which the buttons appear in their HTML structure. The First
button will come before the second
button.