driver.find_element_by_id("element_id").get_attribute("src")
from selenium import webdriver
from selenium.webdriver.common.by import By
image = driver.find_element(By.XPATH, value='//*[@id="app"]/div/div/div[2]/div[1]/div[1]/img')
print(image.get_attribute("scr"))
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('https://moscowsg.megafon.ru/ps/scc/php/cryptographp.php?PHPSESSID=mfc540jkbeme81qjvh5t0v0bnjdr7oc6&ref=114&w=150')
driver.save_screenshot("screenshot.png")
driver.close()
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.action_chains import ActionChains
wait = WebDriverWait(browser, 20)
actions = ActionChains(browser)
product_img_xpath = '//div[contains(@class,"s-item")]//img'
wait.until(EC.visibility_of_element_located((By.XPATH, product_img_xpath)))
time.sleep(1)
imgs = browser.find_elements_by_xpath(product_img_xpath)
for img in imgs:
actions.move_to_element(img).perform()
print(img.get_attribute('src'))