如何使用SELENIUM PYTHON填写亚马逊付款方式 [英] How fill the form of payment amazon using SELENIUM PYTHON

查看:75
本文介绍了如何使用SELENIUM PYTHON填写亚马逊付款方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我代码的一部分,在这里我点击添加信用卡或借记卡"并切换框架,因为我将继续填写表格但出现此错误:

This is a one part of my code, here I do click in 'Add a credit or debit card' and switch the frame, for the I will proceed fill the form but have this error:

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="pp-QqmNYT-14"]"}

这是我的代码部分:

self.__driver.find_element(By.LINK_TEXT, 'Add a credit or debit card').click()
self.__driver.switch_to.frame(self.__driver.find_element_by_tag_name('iframe'))
self.__driver.find_element(By.XPATH, '//*[@id="pp-QqmNYT-14"]').send_keys("user admin")
self.__driver.find_element(By.NAME, 'addCreditCardNumber').send_keys(self.cc)

这是我要填写的表格:https://www.amazon.sg/gp/prime/pipeline/会员注册

推荐答案

看看这是否有效:

self.__driver.switch_to.frame(self.__driver.find_element_by_xpath('.//iframe[contains(@name,'ApxSecureIframe')]'))

这篇关于如何使用SELENIUM PYTHON填写亚马逊付款方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆