title: How do I access a dynamic element with selenium that returns None
body: <p>I'm trying to find an attribute 'src' via selenium to get an image but instead of returning the element. it returns a None type. I think its doing it because it is JavaScript. I want to know is there a way to still get the attribute instead of a None type? please help</p>
  <p>script</p>
  <pre><code>from lib2to3.pgen2 import driver
  from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  from selenium.webdriver.common.by import By
  from selenium.common.exceptions import *
  from selenium import webdriver
  from selenium.webdriver.chrome.service import Service
  from selenium.webdriver.common.alert import Alert
  from webdriver_manager.opera import OperaDriverManager
  from PIL import Image
  import urllib.request
  
  driver = webdriver.Opera(executable_path=OperaDriverManager().install())
  
  video_list = []
  
  url = &quot;https://www.tiktok.com/@nkosazana_daughter&quot;
  
  
  driver.get(url)
  
  try:
      driver.implicitly_wait(30)
      popup = driver.find_element(By.XPATH,'.//*[@id=&quot;tiktok-verify-ele&quot;]/div')
  
      if popup is False:
          driver.quit()
      elif popup is not None:
          popup_pic = driver.find_element(By.XPATH, './/*[@id=&quot;captcha-verify-image&quot;]')
          
  except Exception as e:
      print(e)
  
  finally:
      pic = popup_pic.get_attribute('src')
      urllib.request.urlretrieve(pic, 'pic.png')
      img = Image.open('pic.png')
      print(img.getpixel(xy=(0,5)))
      print(img.getbbox())
      print(img.getbands())
      print(img.getdata(0))
  
      
      pic2 = popup.get_attribute('src')
      print(pic2)
  </code></pre>
  <p>output</p>
  <pre><code>(88, 102, 49)
  (0, 0, 552, 344)
  ('R', 'G', 'B')
  &lt;ImagingCore object at 0x0000025C45276AF0&gt;
  None
  </code></pre>