écrire des valeurs à une cellule d'une ligne dans Excel pour une variable de class en python

J'ai essayé d'écrire des valeurs dans un # 1 dans la feuille Excel à partir de laquelle datatables sont générées. Je n'obtiens aucune erreur ou rien en tant que tel, mais je n'obtiens aucune sortie dans le file excel.

Aussi est-il un moyen simple de find la ligne / colonne est-ce que la cellule pointe?

Ci-dessous, j'ai écrit mon code pour countr un mot spécifique de html et ces valeurs doivent être placées dans un file excel.

from xlwt import Workbook import requests from bs4 import BeautifulSoup import re from selenium import webdriver from xlwt import Workbook from collections import Counter driver = webdriver.Firefox() driver.get("fetch dashboard link") login_test = driver.find_element_by_xpath('//*[@id="authContent"]/form/div/p[2]/a') login_test.click() driver.implicitly_wait(30) a = driver.page_source soup = BeautifulSoup(a, "html.parser") wb = Workbook() sheet1 = wb.add_sheet('Automation') sheet1.write_merge(0,2,0,0,'#') sheet1.write_merge(0,0,1,7,'Test Result') sheet1.write(1,1,'Component') sheet1.write(1,2,'Test Restult') sheet1.write(1,3,'Pass') sheet1.write(1,4,'Fail') sheet1.write(1,5,'Cannot Test') sheet1.write(1,6,'Pass With Concern') sheet1.write(1,7,'Pending') i = 3 j=1 for row_len in range (0,27): sheet1.write(i,0,j) i=i+1 j=j+1 class counter_class: def count(self, tittle, block_code): blockcode_passed = block_code.count("Passed") blockcode_blocked = block_code.count("Blocked") blockcode_fail = block_code.count("Failed") blockcode_retest = block_code.count("Retest") blockcode_cannot_test = block_code.count("Cannot Test") blockcode_completed = block_code.count("Completed") blockcode_passwc = block_code.count("Pass With Concern") blockcode_untested = block_code.count("Untested") ##writing the count values fetched from the top to write it to a row in the excel file. f_r=3 f_c=1 sheet1.write(f_r, f_c, tittle) f_c= f_c + 2 sheet1.write(f_r, f_c, blockcode_passed) f_c= f_c + 1 sheet1.write(f_r, f_c, blockcode_fail) f_c= f_c + 1 sheet1.write(f_r, f_c, blockcode_cannot_test) f_c= f_c + 1 sheet1.write(f_r, f_c, blockcode_cannot_test) f_c= f_c + 1 sheet1.write(f_r, f_c, blockcode_passwc) f_c= f_c + 1 sheet1.write(f_r, f_c, blockcode_untested) f_c=1 f_r=4 print f_r print f_c wb.save('xlwtexample.xls') ##Apps gateway starts here apps_gateway = soup.find_all("div", {"id":"group-3191427"}) apps_gateway_str = str(apps_gateway) apps_gateway_obj=counter_class() apps_gateway_obj.count("appsgateway",apps_gateway_str)