【发布时间】:2018-12-03 16:11:29
【问题描述】:
我正在编写一个脚本,它会在每次运行时检索一封新电子邮件并将其放在我的剪贴板上。
我正在抓取的网站在 javascript 应用程序上运行。我注意到网站末尾有一个 iframe,但 js 应用程序不在其中。 但我无法检索该属性。
AttributeError: 'list' object has no attribute 'get_attribute'
[Finished in 5.8s with exit code 1]
在 Python 3.6 中
from bs4 import BeautifulSoup
import requests
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
driver = webdriver.Chrome('/Users/user/Documents/docs/chromedriver')
url = driver.get('https://getnada.com')
element = driver.find_elements(By.CSS_SELECTOR, 'span.address.what_to_copy')
print(element)
【问题讨论】:
标签: javascript python python-3.x selenium selenium-webdriver