Using text search in Web page with Sikuli

在網頁中如何使用Sikuli找特定字串呢?

原理:

我們可以使用 組合鍵 ctrl + 來放大網頁的比例,使得sikuli的OCR功能找的更清準

 

實作:

for i in range(4):
    type("+", KEY_CTRL)

which = input()  # Let user type the string which user want.

print Region(344,178,124,501).hover(which)

mouseMove(Env.getMouseLocation().offset(-100,-100))

print Region(344,178,124,501).text()

 We can use 'Create Region' icon in sikuli IDE to get Region(344,178,124,501).

   Or Using selectRegion() in the runtime gets the Region(344,178,124,501).

 

相關資料:http://safx-dev.blogspot.tw/2013/04/sikulitips.html

Sample Script : https://github.com/ck1125/sikuli/tree/master/sikuli-ide/sample-scripts

AutoCreatingForThreeJia : https://github.com/SikuliScriptForWuXiaQChuan/AutoCreatingForThreeJia

posted @ 2014-10-20 22:55  jeremyatchina  阅读(352)  评论(0编辑  收藏  举报