Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97778

Changing a list of element from Selenium in Python

$
0
0

I am writing a script that will retrieve a new email and place it on my clipboard everytime I run it.

The site I am scraping runs on a javascript application. I notice an iframe at the end of the website but the js app is outside of it. But I am unable to retrieve the attribute.

AttributeError: 'list' object has no attribute 'get_attribute'
[Finished in 5.8s with exit code 1]

In 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)

Viewing all articles
Browse latest Browse all 97778

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>