Image capture of firefox using python

I wrote a program that captures homepage images using python and selenium.

# -*- coding: utf-8 -*-
import sys

from selenium import webdriver
from selenium.webdriver import FirefoxOptions

'''
Start Firefox and capture the image
'''
if( len( sys.argv ) < 3 ):
	print "Usage: firefox.py [uri] [png]"
	sys.exit( 1 )

opts = FirefoxOptions()
opts.add_argument( "--headless" )
driver = webdriver.Firefox( firefox_options = opts )
driver.set_window_size( 1024,768 )

driver.get( sys.argv[1] )
driver.save_screenshot( sys.argv[2] )

driver.quit()


Recommended Posts

Image capture of firefox using python
Python: Basics of image recognition using CNN
Python: Application of image recognition using CNN
python: Basics of using scikit-learn ①
[Python] Using OpenCV with Python (Image Filtering)
Judgment of backlit image using OpenCV
[Python] Using OpenCV with Python (Image transformation)
Removal of haze using Python detailEnhanceFilter
Implementation of desktop notifications using Python
Image recognition of fruits using VGG16
Basics of binarized image processing with Python
[Python] Extension using inheritance of matplotlib (NavigationToolbar2TK)
Automatic collection of stock prices using python
About building GUI using TKinter of Python
(Bad) practice of using this in Python
[Python] Calculation of image similarity (Dice coefficient)
Grayscale by matrix-Reinventor of Python image processing-
Drawing with Matrix-Reinventor of Python Image Processing-
Study on Tokyo Rent Using Python (3-1 of 3)
Analysis of X-ray microtomography image by Python
Matrix Convolution Filtering-Reinventor of Python Image Processing-
Meaning of using DI framework in Python
Introduction of Python
python image processing
Start using Python
Basics of Python ①
Basics of python ①
Copy of python
Scraping using Python
Image of closure
Introduction of Python
Time variation analysis of black holes using python
Chord recognition using chromagram of python library librosa
Color page judgment of scanned image with python
Get image URL using Flickr API in Python
Introduction of Python Imaging Library (PIL) using HomeBrew
Character encoding when using csv module of python 2.7.3
Image processing? The story of starting Python for
Try using the collections module (ChainMap) of python3
Anonymous upload of images using Imgur API (using Python)
Find the geometric mean of n! Using Python
Python introductory study-output of sales data using tuples-
I tried using the image filter of OpenCV
[Python + OpenCV] Whiten the transparent part of the image
Summary of Excel operations using OpenPyXL in Python
[Python] I tried to judge the member image of the idol group using Keras
[Python] Implementation of clustering using a mixed Gaussian model
[Python] Operation of enumerate
List of python modules
Extract the table of image files with OneDrive & Python
Image processing by matrix Basics & Table of Contents-Reinventor of Python image processing-
Operate Redmine using Python Redmine
Explanation of the concept of regression analysis using python Part 2
Basics of I / O screen using tkinter in python3
[Python] [Word] [python-docx] Simple analysis of diff data using python
Fibonacci sequence using Python
Unification of Python environment
Copy of python preferences
Cut a part of the string using a Python slice
Data analysis using Python 0
Basics of Python scraping basics