I am using "class name" attribute to locate element in Flip-kart like this:
WebElement element = driver.findElement(By.className("_1QZ6fC _3Lgyp8"));
The error I am getting is:
org.openqa.selenium.NoSuchElementException: Unable to locate element: ._1QZ6fC\ _3Lgyp8
HTML code of the element is as follows:
<span class="_1QZ6fC _3Lgyp8">Electronics<svg width="4.7" height="8" viewBox="0 0 16 27" xmlns="http://www.w3.org/2000/svg" class="_3ynUUz"><path d="M16 23.207L6.11 13.161 16 3.093 12.955 0 0 13.161l12.955 13.161z" fill="#fff" class="_3Der3h"></path></svg></span>
Target webelement and website - The "Electronics" category of the header in the URL https://www.flipkart.com/