ScreenShot with Selenium (Python)

Motivation

Purpose

Implementation

For the time being, a script that just creates a file called "screen.png " on the same level and saves ScreenShot there.

screenshot.py


import os
from selenium import webdriver

# URL & File Name
URL = "https://www.google.com"
FILENAME = os.path.join(os.path.dirname(os.path.abspath(__file__)), "screen.png ")

# Open Web Browser & Resize 720P
driver = webdriver.Firefox()
driver.set_window_size(1280, 720) 
driver.get(URL)

# Get Screen Shot
driver.save_screenshot(FILENAME)

# Close Web Browser
driver.quit()

I haven't confirmed the operation. I think it will work. I don't know.

Conclusion

Recommended Posts

ScreenShot with Selenium (Python)
Scraping with Selenium [Python]
Scraping with Selenium + Python Part 1
Scraping with Selenium in Python
Scraping with Selenium + Python Part 2
Scraping with Selenium in Python (Basic)
Scraping with Python, Selenium and Chromedriver
Scraping with selenium
[Python / Selenium] XPath
FizzBuzz with Python3
Scraping with selenium ~ 2 ~
Scraping with Python
Statistics with python
Scraping with Python
Python with Go
Twilio with Python
Play with 2016-Python
Tested with Python
Scraping with Selenium
Beginning with Selenium
with syntax (Python)
Bingo with python
Zundokokiyoshi with python
Excel with Python
Microcomputer with Python
Cast with python
Get html from element with Python selenium
WebUI test with Python2.6 + Selenium 2.44.0 --profile setting
Shared screen screenshot exe app with python
[Python] Automatically operate the browser with Selenium
Practice web scraping with Python and Selenium
Use selenium phantomjs webdriver with python unittest
Python + Selenium + Headless Chromium with aws lambda
Serial communication with Python
Zip, unzip with python
Successful scraping with Selenium
Django 1.11 started with Python3.6
Primality test with Python
Python with eclipse + PyDev.
Socket communication with Python
Data analysis with python 2
Scraping with Python (preparation)
Try scraping with Python.
Learning Python with ChemTHEATER 03
Sequential search with Python
"Object-oriented" learning with python
Run Python with VBA
Handling yaml with python
Solve AtCoder 167 with python
Serial communication with python
[Python] Use JSON with Python
Learning Python with ChemTHEATER 05-1
Learn Python with ChemTHEATER
Automatic operation of Chrome with Python + Selenium + pandas
1.1 Getting Started with Python
Binarization with OpenCV / Python
3. 3. AI programming with Python
Try running Google Chrome with Python and Selenium
Kernel Method with Python
Non-blocking with Python + uWSGI
Scraping with Python + PhantomJS