ボタンをクリックする前にランダムなように見えるポップアップ問題を扱っています。要素が表示されているかどうかを確認する方法があるかどうかを知りたい場合は、要素が表示されていない場合は、スクリプトを実行し続けます。私の現在のスクリプトはエラーを取得し続けます。ポップアップが表示されたら、私のスクリプトはPERFECTを実行します。実際要素が見つからない場合、Python Seleniumスクリプトを実行し続ける
self.driver.get(redirecturl)
self.driver.implicitly_wait(180)
login_frame = self.driver.find_element_by_name('injectedUl')
# switch to frame to access inputs
self.driver.switch_to.frame(login_frame)
# we now have access to the inputs
email = self.driver.find_element_by_id('email')
password = self.driver.find_element_by_id('password')
button = self.driver.find_element_by_id('btnLogin')
# input your email and password below
email.send_keys('')
password.send_keys('')
button.click()
#############
onetouch = self.driver.find_element_by_xpath(".//*[@id='memberReview']/div[2]/div/div/div[2]/div[1]/div[1]/a")
if onetouch.is_displayed():
time.sleep(2)
onetouch.click()
else:
print "onetouch not present....continuing script"
button2 = self.driver.find_element_by_id('confirmButtonTop')
button2.click()
button3 = self.driver.find_element_by_name('dwfrm_payment_paypal')
# if you want to test the program without placing an order, delete the button3.click() below this.........
button3.click
ので、ちょうど私のスクリプトに自分の編集を追加する?? –
@Tonysanchez、はい、あなたはこの変更であなたのスクリプトを編集する必要があります:... –
今はどうなっているか知っていますよ!ありがとう –