trying to delay part of my program

前端 未结 2 2115
天命终不由人
天命终不由人 2021-01-28 10:02

Im trying to take a snapshot of the webpage i open but i need to delay the second part of the code so that the program has time to open the page

Here is the code

<
2条回答
  •  遇见更好的自我
    2021-01-28 10:58

    taking a screenshot with selenium webdriver bindings for python:

    #!/usr/bin/env python
    from selenium import webdriver
    
    browser = webdriver.Firefox()
    browser.get('http://www.google.com/')
    browser.save_screenshot('screenshot.png')
    browser.quit()
    

提交回复
热议问题