J'ai écrit un programme qui capture les images de la page d'accueil en utilisant python et sélénium.
# -*- coding: utf-8 -*-
import sys
from selenium import webdriver
from selenium.webdriver import FirefoxOptions
'''
Démarrez Firefox et capturez l'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