0

I am working with a table with many rows (lets call them a,b,c,d, etc) and with the actual value this rows have in a particular column (that value is a bit 0,1 that can change continously). So a screenshot in a particular moment could be something like this:

Table

Table is not in excel or any other program that let me work with pandas or any similar library. So I have to read the screen directly.

User pass to the program the row that he wants to know and then the program must search for this column and return the value. I am using pyautogui. I am able to find the column and do a "tab" in order to place in the column that I want but I don't know how to read the value there. I tried locateAllOnScreen and seems to not work well (also I dont want all the "1" in the screen, I only want to know if that particular column of that particular row is a 1 or a 0).

Another method that I have though is to do Ctrl+C in the column and then create a txt and paste the value there. After that close the txt and read it with python, but I want to know if there is any other way better than this one.

Zephyr
  • 11,891
  • 53
  • 45
  • 80
  • Is the table rendered as HTML or PDF? Can you explain how what is the file format? I bet there is a way to export the table as CSV and then simply use Pandas to deal with it. – alec_djinn Aug 11 '20 at 08:41
  • No, the table is inside a PLC program (TIA Portal), so its not so easy to "transform" the table to a CSV. Also is important to take into account that the value can change continously, so if I want to work with pandas (that I am not sure that is possible) I will have to create and delete files all the time. – Fernando Lousada Fernández Aug 11 '20 at 08:46
  • 1
    Then you probably need an OCR software to convert the screenshots in proper tables first. Sorry, can't help. Check this https://github.com/cseas/ocr-table or similar. – alec_djinn Aug 11 '20 at 08:50
  • Finally I decided to copy the value of the column and write the value in a txt to read it with python. Probably not the "cleanest" way but it works. Thank you for your time – Fernando Lousada Fernández Aug 11 '20 at 10:59

0 Answers0