Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to take screenshots with selenium webdriver python

from selenium import webdriver
from time import sleep

driver = webdriver.Firefox()
driver.get('https://www.python.org')
sleep(1)

driver.get_screenshot_as_file("screenshot.png")
driver.quit()
print("end...")
Comment

python selenium screenshot

driver.save_screenshot("screenshot.png")
Comment

how to take a screenshot in selenium

Java
Yes, it is possible. The following example is in Java:

WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com/");
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
// Now you can do whatever you need to do with it, for example copy somewhere
FileUtils.copyFile(scrFile, new File("c:	mpscreenshot.png"));
Comment

PREVIOUS NEXT
Code Example
Python :: error warning tkinter 
Python :: how to print hello in python 
Python :: save image url to png python 
Python :: matplotlib add legend axis x 
Python :: number of columns with no missing values 
Python :: drop rows with certain values pandas 
Python :: coronavirus program in python 
Python :: pandas open text file 
Python :: mario dance dance revolution 
Python :: python dict order a dict by key 
Python :: How to convert text into audio file in python? 
Python :: remove characters in array of string python 
Python :: one hot encoding python pandas 
Python :: os file exists 
Python :: python how to get alphabet 
Python :: python poner en mayusculas 
Python :: create django user command line 
Python :: finding if user input is lower or upper in python 
Python :: how to run commands in repl.ot 
Python :: climate change 
Python :: python create 2d array deep copy 
Python :: replace url with text python 
Python :: remove turtle 
Python :: check if user has manage messages discord.py 
Python :: dask show progress bar 
Python :: python if not path exist make path 
Python :: convert categorical column to int in pandas 
Python :: opencv set window size 
Python :: how to change a thread name in python 
Python :: random word py 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =