18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
script for collecting data from html table
I have a urgent requirement to collect all the pincode data from India post wbsite but despite of all my efforts I am unable to get the data avaialble in cells of a table.
Is there any connection of it to the security of the webpage,which is not letting me return data from its table? I have applied normal Javascript for retrieving data but all n vain.
Please send me some piece of code to check if what I am doing is wrong.
Is there any connection of it to the security of the webpage,which is not letting me return data from its table? I have applied normal Javascript for retrieving data but all n vain.
Please send me some piece of code to check if what I am doing is wrong.
This discussion has been closed.
Comments
Have a look at sample code in sahi/userdata/scripts/demo/table_2darray.sah
Regards,
Narayan
Please answer me as when I use the array to display data on a textbox avaialbe on the webpage, it works fine but my every attempt to store the array data somewhere on my system results in failure.
It is not a security related thing. What do the Sahi console and Sahi logs show?
What is $k in
_writeCSVfile($arrayEle[$k],"c:\\Program Write.csv")
?
Try to write to a file name without spaces.
Regards,
Narayan
find the commented lines in the code area and let me know why the behaviour of array element differ in each case.
A few points to note:
1) _writeCSVFile takes a 2D array as input. So if you have a 2D array, you can use a single call to write the contents to file.
_writeCSVFile(array2d, filePath, overwrite, wordSeparator);
2) As specified in the example, you need to fetch the contents of the table from the browser using _set.
So your code should look like:
Let us know if that works.
Regards,
Narayan
Thanks
You are welcome!
Regards,
Narayan