Select and Copy data from a flex webpage using Region.text()

Asked by Ramesh

How do I select and copy data from a flex webpage using Sikuli ? (selection and copy is not allowed in flex / flash web pages). Basically I am trying to find some data after doing some search. Since I couldnt select and copy data and compare, I am not able to conclude whether the search was correct or not. In flex pages right click will show some settings, global settings menu.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Ramesh (kann2011) said :
#1

I am using java to do the sikuli scripting.
1. Open the application using internet explorer
2. Type some text in search box and press search button
Above steps are working using java sikuli script.
Once the results comes, I am not able to copy and compare since its a adobe flex webpage.

Let me know any thoughts on this. I can get the x,y coordinates of starting of the results. But using that x,y co-ordinates, Is there anyway I can read the data?

Revision history for this message
RaiMan (raimund-hocke) said :
#2

Already tried Region.text() (X 1.0rc1) (no chance with 0.10.2)

make a region using your coordinates and hope the text feature returns the text ;-)

If you do not get what you expect then read: bug 695616, bug 695650, bug 701005, bug 701012

Revision history for this message
Ramesh (kann2011) said :
#3

Its working - but we cant assure on the value we are getting from Region.text()!!! What is the reason?

  private void getDataFromWebPageUsingRegion() throws FindFailed {
   // TODO Auto-generated method stub
   scr.wait("imgs/cricinfo.png",180);
                        Match match = scr.find("imgs/cricinfo.png");
                        System.out.println(match.x);
                        System.out.println(match.y);
                        Region reg = new Region(match.x,match.y+50,500,30);
                        System.out.println("text from region "+reg.text());
  }

Actually I tried finding what is there under cricinfo page - I got something like this

text from region Rain
 *wesz Indies 245.5 (50.0 Ow:
 1. {ms

It should have been
Rain
*West Indies 245.5 (50.0 Overs)
Sri Lanka

Revision history for this message
RaiMan (raimund-hocke) said :
#4

OK, it principally works - but you do not get what you expect :-(

the bugs listed above told you already, that there are still some problems with text() (it is still under developement and really experimental), so you have to live with what you get now

Tip: currently you get the best results, when the region represents only one line of text and only contains text (no graphics/symbols).
So to get nearer to what you want, you have to experiment a little bit: first try to read the second line (*West Indies 245.5 (50.0 Overs)), by restricting the region to that line.

hope it helps.

Revision history for this message
Ramesh (kann2011) said :
#5

Now I narrow down to the exact location still the results are different. i know already bugs are there, still wants to know whether there is any date for the next release.

Problem :

42806 is coming as 42sub

I dont think we can rely on this number search :)

Revision history for this message
Tsung-Hsiang Chang (vgod) said :
#6

A way to boost the performance of OCR is to make your text as large as possible. Next release is soon. However, this's a hard problem and we won't fix it in the next release.

Revision history for this message
RaiMan (raimund-hocke) said :
#7

Internally the tesseract OCR engine (http://code.google.com/p/tesseract-ocr/) is used.

So their restrictions apply (e.g. minimum size of font, ...).
Information can be found on their Wiki.

Revision history for this message
RaiMan (raimund-hocke) said :
#8

currently no solution

Can you help with this problem?

Provide an answer of your own, or ask Ramesh for more information if necessary.

To post a message you must log in.