Python-UIAutomation-for-Windows icon indicating copy to clipboard operation
Python-UIAutomation-for-Windows copied to clipboard

Read firefox and Edge browser url

Open riyaz1988 opened this issue 5 years ago • 0 comments
trafficstars

Hi, I have tried to read the URL values in the firefox browser.

win = auto.PaneControl(Depth=1, ClassName='MozillaWindowClass', SubName='Mozilla Firefox')
temp = win.PaneControl(Depth=1, Name=browser).GetChildren()[1].GetChildren()[0]
            for bar in temp.GetChildren():
                last = bar.GetLastChildControl()
                if last and last.Name != '':
                    break
addr_bar = bar.GroupControl(Depth=1, Name='').EditControl()
url = addr_bar.GetValuePattern().Value

When I try to run the above code receiving following error message,

"LookupError: Find Control Timeout: {Depth: 1, ClassName: 'MozillaWindowClass', SubName: 'Firefox', ControlType: PaneControl}"

May I know how to fix the above error and read url value from Firefox and Edge.

Thanks.

riyaz1988 avatar Sep 03 '20 06:09 riyaz1988