1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| import util
import csv
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
countNbLigne = 0
options = Options()
options.add_argument("--user-data-dir=D:\\Temp\\chrome") #Path to your chrome profile
driver = webdriver.Chrome(options=options)
driver.set_window_size(1080, 920)
with open('tableau.csv',newline='') as f:
lire=csv.reader(f)
print(type(lire))
for ligne in lire:
link = ligne[5]
name = ligne[0]
countNbLigne = countNbLigne + 1
print(name)
if not name == 'Nom':
''' Generate document-height screenshot '''
url = link
driver.get(url)
util.fullpage_screenshot(driver, (".\screenshot\screen" + str(countNbLigne) +
"-python-" + name + ".png"))
else:
print('First ligne')
driver.quit() |
Partager