Jump to content

Screen scraping?


Recommended Posts

What is it.  A window or browser?

There are _ie functions for browser, and you can use ControlGetText on each edit|control|whatever for a windows client.

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

Here's the full summary panel:

>>>> Window <<<<
Title:  MIS (A/TEST.5.64.MIS/11) - LAST,FIRST                    *** TEST ***
Class:  MRWF
Position:   1498, 32
Size:   893, 674
Style:  0x16CF0000
ExStyle:    0x00000100
Handle: 0x001F0720

>>>> Control <<<<
Class:  MRWC
Instance:   1
ClassnameNN:    MRWC1
Name:   
Advanced (Class):   [CLASS:MRWC; INSTANCE:1]
ID: 1006
Text:   Enter/Edit Users                                                                            
Position:   3, 2
Size:   829, 609
ControlClick Coords:    47, 103
Style:  0x54C80000
ExStyle:    0x00000140
Handle: 0x00080708

>>>> Mouse <<<<
Position:   1556, 167
Cursor ID:  0
Color:  0xF0F0F0

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Enter/Edit Users                                                                            


>>>> Hidden Text <<<<
MIS USER MENU
MIS MAIN MENU Job 11 TEST.5.64.MIS A Mac
Sign On
(A/TEST.5.64.MIS/11)
MIS Directories
Link to comment
Share on other sites

Here is an example for your control...do the same for the rest...

; your window is already present, and then run this:
$hWin = WinGetHandle("MIS")
$hControl = ControlGetHandle($hWin, "", 1006)
$sText = ControlGetText($hWin, "", $hControl)
ConsoleWrite("control 1006 value=[" & $sText & "].")

; add in another control here:
$hControl2 = ControlGetHandle($hWin, "", 'put another controls id here')
$sText2 = ControlGetText($hWin, "", $hControl2)
ConsoleWrite("control xxxxx value=[" & $sText2 & "].")
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

No luck, all I'm getting is "Enter/Edit Users" which is the internal title bar. I'm not getting anything from the actual screen. Even when I use the Finder Tool in the middle of the screen, it's all 1006

Link to comment
Share on other sites

I'm giving that a shot now, after Ctrl+W on a specific field in Meditech it highlighted the entire window in red and returned:

Mouse position is retrieved 1858-569
At least we have an element [Enter/Edit Users                                                                            ][MRWC]

Having the following values for all properties: 
Title is: <Enter/Edit Users                                                                            >    Class   := <MRWC>   controltype:= <UIA_WindowControlTypeId> ,<50032>    , (0000C370)    1654;162;829;609
*** Parent Information top down ***
2: Title is: <Desktop>  Class   := <#32769> controltype:= <UIA_PaneControlTypeId>   ,<50033>    , (0000C371)    0;0;1440;900
"Title:=Desktop;controltype:=UIA_PaneControlTypeId;class:=#32769"   
1: Title is: <MIS (A/LIVE.MIS/99) - Last,First> Class   := <MRWF>   controltype:= <UIA_WindowControlTypeId> ,<50032>    , (0000C370)    1643;130;893;674
"Title:=MIS (A/LIVE.MIS/99) - Last,First;controltype:=UIA_WindowControlTypeId;class:=MRWF"  
0: Title is: <Workspace>    Class   := <MDIClient>  controltype:= <UIA_PaneControlTypeId>   ,<50033>    , (0000C371)    1651;160;851;636
"Title:=Workspace;controltype:=UIA_PaneControlTypeId;class:=MDIClient"  


;~ *** Standard code ***
#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)

Local $oP1=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=MIS (A/LIVE.MIS/99) - Last,First;controltype:=UIA_WindowControlTypeId;class:=MRWF", $treescope_children)  
_UIA_Action($oP1,"setfocus")
Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=Workspace;controltype:=UIA_PaneControlTypeId;class:=MDIClient", $treescope_children)   
_UIA_Action($oP0,"setfocus")
_UIA_setVar("Enter/EditUsers.mainwindow","title:=Enter/Edit Users                                                                            ;classname:=MRWC")
_UIA_action("Enter/EditUsers.mainwindow","setfocus")


*** Detailed properties of the highlighted element ***
UIA_title:= <Enter/Edit Users                                                                            >
UIA_text:= <Enter/Edit Users                                                                            >
UIA_regexptitle:= <Enter/Edit Users                                                                            >
UIA_class:= <MRWC>
UIA_regexpclass:= <MRWC>
UIA_iaccessiblechildId:= <0>
UIA_id:= <1006>
UIA_handle:= <526292>
UIA_RuntimeId:= <42;526292>
UIA_BoundingRectangle:= <1654;162;829;609>
UIA_ProcessId:= <6772>
UIA_ControlType:= <50032>
UIA_LocalizedControlType:= <window>
UIA_Name:= <Enter/Edit Users                                                                            >
UIA_HasKeyboardFocus:= <True>
UIA_IsKeyboardFocusable:= <True>
UIA_IsEnabled:= <True>
UIA_AutomationId:= <1006>
UIA_ClassName:= <MRWC>
UIA_Culture:= <0>
UIA_IsControlElement:= <True>
UIA_IsContentElement:= <True>
UIA_IsPassword:= <False>
UIA_NativeWindowHandle:= <526292>
UIA_IsOffscreen:= <False>
UIA_Orientation:= <0>
UIA_FrameworkId:= <Win32>
UIA_IsRequiredForForm:= <False>
UIA_IsDockPatternAvailable:= <False>
UIA_IsExpandCollapsePatternAvailable:= <False>
UIA_IsGridItemPatternAvailable:= <False>
UIA_IsGridPatternAvailable:= <False>
UIA_IsInvokePatternAvailable:= <False>
UIA_IsMultipleViewPatternAvailable:= <False>
UIA_IsRangeValuePatternAvailable:= <False>
UIA_IsScrollPatternAvailable:= <False>
UIA_IsScrollItemPatternAvailable:= <False>
UIA_IsSelectionItemPatternAvailable:= <False>
UIA_IsSelectionPatternAvailable:= <False>
UIA_IsTablePatternAvailable:= <False>
UIA_IsTableItemPatternAvailable:= <False>
UIA_IsTextPatternAvailable:= <False>
UIA_IsTogglePatternAvailable:= <False>
UIA_IsTransformPatternAvailable:= <True>
UIA_IsValuePatternAvailable:= <False>
UIA_IsWindowPatternAvailable:= <True>
UIA_ValueIsReadOnly:= <True>
UIA_RangeValueValue:= <0>
UIA_RangeValueIsReadOnly:= <True>
UIA_RangeValueMinimum:= <0>
UIA_RangeValueMaximum:= <0>
UIA_RangeValueLargeChange:= <0>
UIA_RangeValueSmallChange:= <0>
UIA_ScrollHorizontalScrollPercent:= <0>
UIA_ScrollHorizontalViewSize:= <100>
UIA_ScrollVerticalScrollPercent:= <0>
UIA_ScrollVerticalViewSize:= <100>
UIA_ScrollHorizontallyScrollable:= <False>
UIA_ScrollVerticallyScrollable:= <False>
UIA_SelectionCanSelectMultiple:= <False>
UIA_SelectionIsSelectionRequired:= <False>
UIA_GridRowCount:= <0>
UIA_GridColumnCount:= <0>
UIA_GridItemRow:= <0>
UIA_GridItemColumn:= <0>
UIA_GridItemRowSpan:= <1>
UIA_GridItemColumnSpan:= <1>
UIA_DockDockPosition:= <5>
UIA_ExpandCollapseExpandCollapseState:= <3>
UIA_MultipleViewCurrentView:= <0>
UIA_WindowCanMaximize:= <False>
UIA_WindowCanMinimize:= <False>
UIA_WindowWindowVisualState:= <0>
UIA_WindowWindowInteractionState:= <2>
UIA_WindowIsModal:= <False>
UIA_WindowIsTopmost:= <False>
UIA_SelectionItemIsSelected:= <False>
UIA_TableRowOrColumnMajor:= <2>
UIA_ToggleToggleState:= <2>
UIA_TransformCanMove:= <True>
UIA_TransformCanResize:= <False>
UIA_TransformCanRotate:= <False>
UIA_IsLegacyIAccessiblePatternAvailable:= <True>
UIA_LegacyIAccessibleChildId:= <0>
UIA_LegacyIAccessibleName:= <Enter/Edit Users                                                                            >
UIA_LegacyIAccessibleRole:= <10>
UIA_LegacyIAccessibleState:= <1048580>
UIA_IsDataValidForForm:= <False>
UIA_ProviderDescription:= <[pid:1972,hwnd:0x807D4 Main:Nested [pid:6772,hwnd:0x807D4 Annotation(parent link):Microsoft: Annotation Proxy (unmanaged:uiautomationcore.dll); Main:Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]; Nonclient:Microsoft: Non-Client Proxy (unmanaged:uiautomationcore.dll); Hwnd(parent link):Microsoft: HWND Proxy (unmanaged:uiautomationcore.dll)]>
UIA_IsItemContainerPatternAvailable:= <False>
UIA_IsVirtualizedItemPatternAvailable:= <False>
UIA_IsSynchronizedInputPatternAvailable:= <False>

It's still just grabbing the inner title bar? I've attached how it looked when I hit Ctrl+W, and the green is where my cursor was.

 

post-90462-0-98577800-1425595822_thumb.p

Link to comment
Share on other sites

  • 1 year later...
  • 3 years later...

anyone found solution to this problem so far ? I face simillar issue. I use Meditek application to make some data entry. I wish to automate this task. I managed to enter username, password and got though few screens . I am stuck at on screen , where I need to read the focused text box , which I am not able to do. Can anyone please help? It is MDIClient window and shows all buttons when I try to display controls and their values. Please see screenshot. I want to read red circled text.

 

 

Capture.PNG

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...