Selenium click CSS items that have the same class name


I'm trying to click the second element where "class=uiComposerAttachment photoAttachment"

Something different from XPath, is using the nth-child locator in CSS. Note this isn't supported in IE8 and below, but other modern browsers will be fine. Example to get the 2nd element: