Click the javascript popup through webdriver

前端 未结 6 759
再見小時候
再見小時候 2020-12-05 10:58

I am scraping a webpage using Selenium webdriver in Python

The webpage I am working on, has a form. I am able to fill the form and then I click on the Submit button.

6条回答
  •  半阙折子戏
    2020-12-05 11:30

    Try The Code below! Working Fine for me!

    alert = driver.switch_to.alert
    try:
       alert.accept() #If you want to Accept the Alert
    except:
       alert.dismiss()  #If  You want to Dismiss the Alert.
    

提交回复
热议问题