我正在尝试提取ID的标签或标题,并且正在使用Facebook进行实验。我希望打印出的结果是“电子邮件或电话”,但我无法成功打印。
from selenium import webdriver
url = 'https://www.facebook.com/'
#this is where chrome is stored in my computer
driver = webdriver.Chrome("C:\Program Files
(x86)\Google\Chrome\Application\chromedriver")
driver.get(url)
d = driver.find_element_by_id('email')
label = d.get_attribute('label')
print(label)