title: How can I make Selenium click on a href by css selector?
body: <p>I have been trying to make a Selenium bot that searches for a word on github, clicks on the first link and then downloads it with Python 3.8 and I got stuck with making the bot click on the hyperlink. I understand that I can make the bot click on it with <code>driver.find_element(By.XPATH, &quot;Xpath&quot;).click()</code> but I want to be able to find the path of the href with another method for the sake of learning, in this case CSS_SELECTOR. Source code of the first hyperlink result is like this:</p>
  <p>HTML:</p>
  <p><img src="https://i.stack.imgur.com/pGlZb.png" alt="source code" /></p>
  <p>Since every single result is under the same &quot;a&quot; selector with a class of &quot;v-align-middle&quot;, I thought of using this code: <code>driver.find_element(By.CSS_SELECTOR, &quot;.v-align-middle&quot;).click()</code> but it did not seem to work. What am I missing?</p>