Is there any way in Gatling open source to fetch the data from Gatling report and put that data into a CSV file?
I have tried to create a python script that is taking the index.html report generated by Gatling once the test execution is completed but the problem is data in the index.html is getting filled by some javascript code the data is not present in the html. I have used bs4 to scrap but it didn’t work.
Can anyone please help me out.
My code:
def read_zip_file(zip_file_path,zip_file_path2,html_file):
with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
with zip_ref.open(zip_file_path2, 'r') as zip_ref2:
inner_zip_data = zip_ref2.read()
inner_zip = zipfile.ZipFile(io.BytesIO(inner_zip_data))
with inner_zip.open(html_file) as html_file:
html_content = html_file.read().decode('utf-8')
soup = BeautifulSoup(html_content, "html.parser")
containers = soup.find_all(id="container_statistics_body")
td_element = soup.select_one('td.value.ok.col-3')
print(containers)
# with open("table.csv", "w", newline="") as csvfile:
# writer = csv.writer(csvfile)
# writer.writerow(columns)
zip_file_path = "USEast1login.zip"
zip_file_path2 = "results-aggregated-login-1684262709.zip"
html_file = 'aggregated-results/aggregated/index.html'
read_zip_file(zip_file_path,zip_file_path2,html_file)