trying to delay part of my program

前端 未结 2 2084
天命终不由人
天命终不由人 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:49

    you can try to use time.sleep(seconds) to let your program delay for a while.

    0 讨论(0)
  • 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()
    
    0 讨论(0)
提交回复
热议问题