""" This script uses a simplified version of the one here: https://snipt.net/restrada/python-selenium-workaround-for-full-page-screenshot-using-chromedriver-2x/ It contains the *crucial* correction added in the comments by Jason Coutu. """ import sys from selenium import webdriver import unittest import util import csv countNbLigne = 0 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': class Test(unittest.TestCase): """ Demonstration: Get Chrome to generate fullscreen screenshot """ def setUp(self): self.driver = webdriver.Chrome() self.driver.set_window_size(1080, 920) def tearDown(self): self.driver.quit() def test_fullpage_screenshot(self): ''' Generate document-height screenshot ''' url = link self.driver.get(url) util.fullpage_screenshot(self.driver, (".\screenshot\screen" + str(countNbLigne) + ".png")) if __name__ == "__main__": unittest.main(argv=[sys.argv[0]]) else: print('First ligne')