Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f2e1fa2

Browse files
author
Baiju Muthukadan
committed
screenshot
1 parent 62aa4b7 commit f2e1fa2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

source/faq.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,15 @@ First download the Firebug XPI file, later you call the
113113
fp.set_preference("extensions.firebug.currentVersion", "1.8.4") #Avoid startup screen
114114
browser = webdriver.Firefox(firefox_profile=fp)
115115

116+
How to take screenshot of the current window ?
117+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
118+
119+
Use the `save_screenshot` method provided by the webdriver::
120+
121+
from selenium import webdriver
122+
123+
driver = webdriver.Firefox()
124+
driver.get('http://www.python.org/')
125+
driver.save_screenshot('screenshot.png')
126+
driver.quit()
127+

0 commit comments

Comments
 (0)