15 and I need to upgrade to 4.1 but it is still not working.
my code:
from selenium import webdriver
import os.path
import requests
driver = webdriver.Firefox(executable_path="C:\\geckodriver.exe")
tag = "test"
driver.get("https://www.pexels.com/search/" + tag +"/?orientation=landscape&size=medium")
images = driver.find_elements_by_name('img')
l = 0
for image in images:
src = image.get_attribute('src')
l = +1
try:
if src[8] == "i":
if src[26] == "p":
src = src.replace('?auto=compress&cs=tinysrgb&dpr=1&w=500', '')
if os.path.exists(tag+".txt"):
links = open(tag+".txt", "a")
link = src + "\n"
links.write(link)
else:
links = open(tag+".txt", "w")
driver.quit()
I do not remember these images = driver.find_elements_by_name very well so I do not know how I had it but important is it is working I read on the Internet something like I need to use A Be but is not working.