PythonでSeleniumを使用してブラウザを自動化しようとすると問題が発生します。 :フレームボックス(Python Selenium)をクリックするスイッチ
私は私の問題について説明しています: 私はRecaptchaのボックスをクリックしなければなりません。これを行うには、私のボットは。
:The popup of the recaptcha, in which the checkbox is located
The location of the checkbox that I have to click
私はこのコードを試してみてください。そして、私は検証する必要がありreCAPTCHAのを表示するサイト、上のボタン ここでは、ソース・ページのスクリーンショットです
time.sleep(5)
browser.switch_to_frame(browser.find_element_by_tag_name("CaptchaPopup"))
browser.switch_to_frame(browser.find_element_by_tag_name("iframe"))
CheckBox = WebDriverWait(browser, 10).until(
browser.find_element_by_id('recaptcha-anchor').click())
time.sleep(0.7)
CheckBox.click()
しかし、私のエラー:(私は、Python 2.7を使用
selenium.common.exceptions.NoSuchFrameException: Message: no such frame
後者戻ります。 ソリューションはありますか? ありがとうございます!
は、ブラウザ( 'browser.switch_to_frame(browser.find_element_by_tag_name( "CaptchaPopup"))上の例外を取得または' 'browser.switch_to_frameました。 find_element_by_tag_name( "iframe")) '? – Andersson
browser.switch_to_frame(browser.find_element_by_tag_name( "Ca ptchaPopup"))私は知っています:/ http://prntscr.com/fth7vq –
このような 'name'を持つ' iframe'があると確信していますか?提供された「HTML」の部分にこのような属性はありません – Andersson