Skip to main content

Posts

Showing posts from November, 2021

Python openpyxl - Excel Automation Functions

  import openpyxl from openpyxl import Workbook import pandas as pd from openpyxl.utils.dataframe import dataframe_to_rows class Excel_Operation ():     def Create_Workbook ( self , strWorkbookPath ):         """Create New excel workbook in the given folder location         Parameters:         strWorkbookPath (String): Path to store excel workbook         Returns:         Object: Workbook         """         wb = Workbook()         wb.save(strWorkbookPath)         return wb     def Load_Workbook ( self , strWorkbookPath ):         wb = openpyxl.load_workbook(strWorkbookPath)         return wb     def Change_worksheetName ( self , strWorkbookPath , strOldSheetName , strNewSheetName ):         wb = openpyxl.load_workbook(strWorkbookPath)         ws = wb[strOldSheetName]         ws.title = strNewSheetName         wb.save(strWorkbookPath)     def Create_Worksheet ( self , strWorkbookPath , intIndex , strWorkSheetName ):         wb = openpyxl.load

Python Selenium Webdriver Function

  #****************************************************************************************************** #Reference Links     #https://selenium-python.readthedocs.io/     #https://selenium-python.readthedocs.io/api.html #******************************************************************************************************* #Import Selenium Webdriver Common from selenium import webdriver from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By import selenium.webdriver.support.ui as ui from selenium.common.exceptions import TimeoutException from selenium.webdriver.chrome.options import Options from selenium.common.exceptions import ElementNotVisibleException from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import WebDriverException from selenium.webdriver.common.keys import Keys from distutils.dir_util import copy_tree from selenium import webdriver from selenium.w