When iframes do not have name,ids its very hard to identify them or switch to correct iframes.
Below is an example where we can understand the scenario in better way.
Below is an example where iframes do not have name,ids but you can easily notice that both the iframes have src with them.
we can use src to uniquely identify and switch to the correct iframe.
To identify the correct iframe with src we can use below technique.
driver.switchTo().frame(driver.findElement(By.xpath("//iframe[contains(@src,'Enter here the unique text which belongs to your iframe')]")));