如何使用';获取属性';方法在selenium中使用python

如何使用';获取属性';方法在selenium中使用python,python,python-3.x,selenium,pycharm,Python,Python 3.x,Selenium,Pycharm,img alt=”“src=”https://images-na.ssl-images-amazon.com/images/I/41RysbN85LL.SY90.jpg“aria hidden=“true”onload=“if(typeof uet==“function”){uet('cf');uet('af');}”class=“yo critical feature”height=“90”width=“90”title=“适用于iWatch系列5/4/3/2/1和OS6.0以上的USB A/

img alt=”“src=”https://images-na.ssl-images-amazon.com/images/I/41RysbN85LL.SY90.jpg“aria hidden=“true”onload=“if(typeof uet==“function”){uet('cf');uet('af');}”class=“yo critical feature”height=“90”width=“90”title=“适用于iWatch系列5/4/3/2/1和OS6.0以上的USB A/C端口手表充电器磁性电缆,与iPhone11/Pro/Max/XR/XS Max/X/iPhone8/7/6/Plus和Air pods 1/2/3兼容的2in1手表和手机充电器电缆”data-A-hires=”https://images-na.ssl-images-amazon.com/images/I/41RysbN85LL.SY180.jpg“>

下面是HTML代码

   for i in range(qty): # qty = 3
            cnt = "//*[@id='orderDetails']/div[5]/div/div/div/div[1]/div/div[{0}]/div/div[1]/div/a/img".format(i+1)
            test.append(cnt)

            product_img  = WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH,
                    test[i]))).get_attribute("src")
            product_name = WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH,
                    test[i]))).get_attribute("title")
嗨,这是我想在img标签中获得'src','title'属性的代码 但是错误出现了

raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message 文件“”,第1行,在 AttributeError:'list'对象没有属性'get\u attribute' 请告诉我有什么办法
find_元素也使用循环。或者切换以查找_元素。在代码的第一位中,expectedcondition将返回一个webelement,但是,在它返回等待之前运行该方法。不要这样做…让它返回webelement。然后在返回的元素上运行.get_属性。例如:product_img_element=WebDriverWait…然后n下一行product\u img=product\u img\u元素。获取属性(“src”)
product_img = driver.find_elements_by_xpath("//*[@id='orderDetails']/div[5]/div/div/div/div[1]/div/div[1]/div/div[1]/div/a/img").get_attribute("src")
File "", line 1, in AttributeError: 'list' object has no attribute 'get_attribute' Please tell me any ways