嗨我有一个关于python和selenium的问题我试图从链接中获取文本并打印它但它不会打印出我的代码在下面的文本:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Safari()
driver.implicitly_wait(6)
driver.get("http://www.google.ca")
name=driver.find_element_by_xpath("""//*[@id="lst-ib"]""")
name.send_keys('how old is Obama')
name.send_keys(Keys.ENTER)
name2=driver.find_element_by_class_name("_uX kno-fb-ctx").text
print(name2)