Seems you were almost there. Perhaps, as per the HTML and your code trials you have shared, you are seeing the desired output.
Explaination
Once the following line of code gets executed:
At = driver.find_elements_by_css_selector ('#gs_res_ccl_mid > div:nth-child(1) > div.gs_ri > div.gs_a')
WebElement At refers to the desired element(single element in your list). In your next step, as you invoked print (At)
the WebElement At is printed which is as follows:
selenium.webdriver.remote.webelement.WebElement (session="9aa956e2bd51f510dd626f6937b01c0e", element="0.6506218589189958-1")
Solution
Now, as per your question, if you want to extract the text LR Binford - American antiquity, 1980 - cambridge.org, you have to invoke either of the methods through the element:
So you need to change the line of code from:
print (At)
To either of the following:
Using text
:
print(At.text)
Using get_attribute(attributeName)
:
print(At.get_attribute("innerHTML"))
Your own code with minor adjustments:
# -*- coding: UTF-8 -*-
from selenium import webdriver
def Author (SearchVar):
options = webdriver.ChromeOptions()
options.add_argument("start-maximized")
options.add_argument('disable-infobars')
driver=webdriver.Chrome(chrome_options=options, executable_path=r'C:\Utility\BrowserDrivers\chromedriver.exe')
driver.get ("https://scholar.google.com/")
SearchBox = driver.find_element_by_name("q")
SearchBox.send_keys(SearchVar)
SearchBox.submit()
At = driver.find_elements_by_css_selector ('#gs_res_ccl_mid > div:nth-child(1) > div.gs_ri > div.gs_a')
for item in At:
print(item.text)
Author("dog")
Console Output:
…, RJ Marles, LS Pellicore, GI Giancaspro, TL Dog - Drug Safety, 2008 - Springer