Would like to ask question regarding in selenium
automation using Python
(PyCharm
)
I have a test data which is masked as .xls
file. This is an HTML
file masked in XLS
format
I already found a code to convert this one (Link)
Here is the code:
bunch_size = 10000000 # Experiment with different sizes
bunch = []
with open(test_path+final_date+".xls", "r") as r, open(location_of_html, "w") as w:
for line in r:
print(line)
x, y, z, rest = line.split(' ', 3)
bunch.append(' '.join((x[:-3], y[:-3], z[:-3], rest)))
if len(bunch) == bunch_size:
w.writelines(bunch)
bunch = []
w.writelines(bunch)
The code above produce this line which is correct:
<table style='height: 184px;' width='518'>
<tbody>
<tr>
<td style='text-align: center;'> <img /></td>
<td style='text-align: center;' colspan='3'><span style='font-size: 12pt;'> <strong>Villanueva Enterprise</strong> </span><br /><span style='font-size: 10pt;'> <strong>Payslip</strong> </span></td>
<td> </td>
</tr>
<tr>
<td><span style='font-size: 8pt;'>NAME:</span></td>
But when the end product is converted, the produced code is:
<ta style="heig 184p width=" 518'="">
<img>
<span style="font-size: 12pt;"> <strong>Villanueva Enterprise</strong> </span><br><span style="font-size: 10pt;"> <strong>Payslip</strong> </span>
<span style="font-size: 8pt;">NAME:</span>
<span style="font-size: 8pt;">Earner Minimum Wage 620,350</span>
<span style="font-size: 8pt;">PAYROLL DATE: </span>
<span style="font-size: 8pt;">26 March 2021 </span>
Any ideas?