I am attempting to utilize Selenium to retrieve some data from Google, but the CssSelector I have implemented is consistently returning "No element found".
Below is my code snippet:
//Open google page
IWebDriver driver = new FirefoxDriver();
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
driver.Navigate().GoToUrl("https://www.google.com/search?q=cheese");
wait.Until(driver1 => ((IJavaScriptExecutor)driver).ExecuteScript("return document.readyState").Equals("complete"));
//Get image link
IWebElement image_link = driver.FindElement(By.CssSelector("a[class='q qs']"));
The error occurs on the last line and the anchor tag I'm trying to access has the following structure on the webpage.
<a class="q qs" href="/search?q=cheese&client=firefox-a&hs=YWQ&rls=org.mozilla:en-US:official&source=lnms&tbm=isch&sa=X&ei=ewL9U-S5FNGpyATTl4CgCA&ved=0CAgQ_AUoAQ">Images</a>
What could be causing this issue?