This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review
– Bharat ManeJul 2 '17 at 18:17

Hi Bharat why did you say "This does not provide an answer to the question. Because he was asking how to get the 1st image.So what i did was get all the things which have img tag to an array and select the 1st element on it.
– ChathuDJul 3 '17 at 5:46

@ChathuD The problem with your answer is that you are getting the first img tag from all the img tags on the page. The question was how to get the first img from a specific subset of img tags on the page.
– NotInventedHereJul 8 '17 at 0:15

In that case user can edit the 1st line and search the img tag inside a specific area.Becouse when i write this code i was in a assumption where the 1st img tag will be the required img on the above web page.So how could my answer will be " This does not provide an answer to the question".
– ChathuDJul 8 '17 at 6:08

@ChathuD Hey man don't shoot the messenger. I was just letting you know what the problem was so you could fix it yourself. I've given a correct answer to the actual question asked and still got 3 down votes without anyone saying why. That's life :)
– NotInventedHereJul 10 '17 at 23:16

Honestly though, this is a rat's nest from hell. If I were you I'd have a serious discussion with the developers about getting some tags in there that you can actually rely on. Right now there's very little in that page that can be located reliably.

@GeorgeMcConnon I don't think these two are equivalent. I was more up to using findElement to find the first occurrence of the desired element - the selector is just something concise and reasonable I've come up with..thanks.
– alecxe♦Jul 8 '17 at 1:01

You should not use the _1UoZIX identifier. It's generated on the fly (dynamically) and changes over time. It also has no semantic meaning, doesn't say fridge at all

Getting to the 'first search result image' element generically, i.e. first result and not just when it is that fridge... is going to be a challenge given the layout. One approach that might work is (pseudo code) a locator that is something like

//div a[@href='/']/img[2]

i.e. find the main div based on the home anchor within it and then look for the second image within that div. I don't like this much but this is due to the page structure presented. Some version of this may work.

Also, unless you use relative addressing I prefer css locators for readability and compactness, e.g.