Как использовать pywinauto для автоматизации обновлений Microsoft Store

#python #automation #pywinauto

Вопрос:

Я пытаюсь создать скрипт для автоматической проверки обновлений в магазине Microsoft с помощью pywinauto, поскольку опция «Автоматическое обновление» редко работает так, как предназначено для игры Ark: Survival Evolved.

Вот мой тестовый сценарий на данный момент:

 from pywinauto.application import Application
app = Application(backend="uia").connect(title="Microsoft Store")

dlg = app.window(title='Microsoft Store')

dlg.print_control_identifiers()

for button in app.windows()[0].descendants(control_type="Button"):
    if "See More" in str(button):
        print(button)
        button.click()
        sleep(1)
        for button2 in app.windows()[0].descendants(control_type="Button"):
            if "Downloads and updates" in str(button2):
                print(button2)
                button2.click()
                sleep(1)
                for button3 in app.windows()[0].descendants(control_type="Button"):
                    print(button3)
                    if "Get updates" in str(button3):
                        print(button3)
                        button3.click()
 

Этот вид работает. Однако я хотел бы более эффективный способ, чем просто повторять все каждый раз

Вот печатные элементы управления для главного окна магазина Microsoft:

 C:Python38python.exe "C:/Users/GAMER/Desktop/GitHub Projects/tests/pywinauto_test.py"
Control Identifiers:

Dialog - 'Microsoft Store'    (L-1805, T253, R-187, B1098)
['Microsoft Store', 'Microsoft StoreDialog', 'Dialog', 'Microsoft Store0', 'Microsoft Store1', 'Microsoft StoreDialog0', 'Microsoft StoreDialog1', 'Dialog0', 'Dialog1']
child_window(title="Microsoft Store", control_type="Window")
   | 
   | Dialog - 'Microsoft Store'    (L-429, T254, R-196, B294)
   | ['Microsoft Store2', 'Microsoft StoreDialog2', 'Dialog2']
   | child_window(title="Microsoft Store", auto_id="TitleBar", control_type="Window")
   |    | 
   |    | Menu - 'System'    (L0, T0, R0, B0)
   |    | ['Menu', 'SystemMenu', 'System', 'System0', 'System1']
   |    | child_window(title="System", auto_id="SystemMenuBar", control_type="MenuBar")
   |    |    | 
   |    |    | MenuItem - 'System'    (L0, T0, R0, B0)
   |    |    | ['MenuItem', 'System2', 'SystemMenuItem']
   |    |    | child_window(title="System", control_type="MenuItem")
   |    | 
   |    | Button - 'Minimize Microsoft Store'    (L-367, T254, R-310, B294)
   |    | ['Button', 'Minimize Microsoft Store', 'Minimize Microsoft StoreButton', 'Button0', 'Button1']
   |    | child_window(title="Minimize Microsoft Store", auto_id="Minimize", control_type="Button")
   |    | 
   |    | Button - 'Maximize Microsoft Store'    (L-310, T254, R-253, B294)
   |    | ['Button2', 'Maximize Microsoft Store', 'Maximize Microsoft StoreButton']
   |    | child_window(title="Maximize Microsoft Store", auto_id="Maximize", control_type="Button")
   |    | 
   |    | Button - 'Close Microsoft Store'    (L-253, T254, R-196, B294)
   |    | ['Button3', 'Close Microsoft Store', 'Close Microsoft StoreButton']
   |    | child_window(title="Close Microsoft Store", auto_id="Close", control_type="Button")
   | 
   | Dialog - 'Microsoft Store'    (L-1796, T254, R-196, B1089)
   | ['Microsoft Store3', 'Microsoft StoreDialog3', 'Dialog3']
   | child_window(title="Microsoft Store", control_type="Window")
   |    | 
   |    | Custom - ''    (L-1796, T254, R-196, B1089)
   |    | ['Microsoft StoreCustom', 'Custom', 'Microsoft StoreCustom0', 'Microsoft StoreCustom1', 'Custom0', 'Custom1']
   |    | child_window(auto_id="NavigationChrome", control_type="Custom")
   |    |    | 
   |    |    | Button - ''    (L-1796, T254, R-196, B1089)
   |    |    | ['Button4', 'Microsoft StoreButton']
   |    |    | child_window(auto_id="NavigationControl", control_type="Button")
   |    |    |    | 
   |    |    |    | Custom - ''    (L-1796, T254, R-196, B1089)
   |    |    |    | ['Microsoft StoreCustom2', 'Custom2']
   |    |    |    | child_window(auto_id="NavView", control_type="Custom")
   |    |    |    |    | 
   |    |    |    |    | Button - 'Back'    (L-1796, T294, R-1746, B354)
   |    |    |    |    | ['Button5', 'Back', 'BackButton']
   |    |    |    |    | child_window(title="Back", auto_id="NavigationViewBackButton", control_type="Button")
   |    |    |    |    | 
   |    |    |    |    | Pane - ''    (L-1736, T294, R-1142, B354)
   |    |    |    |    | ['Pane', 'Microsoft StorePane', 'Pane0', 'Pane1', 'Microsoft StorePane0', 'Microsoft StorePane1']
   |    |    |    |    |    | 
   |    |    |    |    |    | GroupBox - ''    (L-1736, T294, R-1143, B354)
   |    |    |    |    |    | ['GroupBox', 'Microsoft StoreGroupBox']
   |    |    |    |    |    | child_window(auto_id="TopNavMenuItemsHost", control_type="Group")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | TabItem - 'Home'    (L-1736, T294, R-1646, B354)
   |    |    |    |    |    |    | ['HomeTabItem', 'TabItem', 'Home', 'TabItem0', 'TabItem1']
   |    |    |    |    |    |    | child_window(title="Home", auto_id="home", control_type="TabItem")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | TabItem - 'Gaming'    (L-1646, T294, R-1539, B354)
   |    |    |    |    |    |    | ['Gaming', 'GamingTabItem', 'TabItem2']
   |    |    |    |    |    |    | child_window(title="Gaming", auto_id="gaming", control_type="TabItem")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | TabItem - 'Entertainment'    (L-1539, T294, R-1371, B354)
   |    |    |    |    |    |    | ['Entertainment', 'EntertainmentTabItem', 'TabItem3']
   |    |    |    |    |    |    | child_window(title="Entertainment", auto_id="entertainment", control_type="TabItem")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | TabItem - 'Productivity'    (L-1371, T294, R-1225, B354)
   |    |    |    |    |    |    | ['ProductivityTabItem', 'Productivity', 'TabItem4']
   |    |    |    |    |    |    | child_window(title="Productivity", auto_id="productivity", control_type="TabItem")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | TabItem - 'Deals'    (L-1225, T294, R-1143, B354)
   |    |    |    |    |    |    | ['Deals', 'TabItem5', 'DealsTabItem']
   |    |    |    |    |    |    | child_window(title="Deals", auto_id="deals", control_type="TabItem")
   |    |    |    |    | 
   |    |    |    |    | AppBar - ''    (L-441, T294, R-196, B354)
   |    |    |    |    | ['AppBar', 'Microsoft StoreAppBar']
   |    |    |    |    | child_window(auto_id="NavigationCommandBar", control_type="AppBar")
   |    |    |    |    |    | 
   |    |    |    |    |    | Button - 'Search'    (L-441, T294, R-316, B354)
   |    |    |    |    |    | ['Button6', 'SearchButton', 'Search']
   |    |    |    |    |    | child_window(title="Search", auto_id="NavSearchButton", control_type="Button")
   |    |    |    |    |    | 
   |    |    |    |    |    | Button - 'User profile'    (L-316, T294, R-256, B354)
   |    |    |    |    |    | ['Button7', 'User profile', 'User profileButton']
   |    |    |    |    |    | child_window(title="User profile", auto_id="UserProfileButton", control_type="Button")
   |    |    |    |    |    | 
   |    |    |    |    |    | Button - 'See More'    (L-255, T294, R-196, B354)
   |    |    |    |    |    | ['Button8', 'See MoreButton', 'See More']
   |    |    |    |    |    | child_window(title="See More", auto_id="MoreButton", control_type="Button")
   |    |    |    |    | 
   |    |    |    |    | Pane - ''    (L-1796, T354, R-196, B1089)
   |    |    |    |    | ['Pane2', 'Microsoft StorePane2']
   |    |    |    |    | child_window(auto_id="_scrollViewer", control_type="Pane")
   |    |    |    |    |    | 
   |    |    |    |    |    | Custom - 'Spotlight'    (L-1766, T354, R-226, B1008)
   |    |    |    |    |    | ['Spotlight', 'SpotlightCustom', 'Custom3']
   |    |    |    |    |    | child_window(title="Spotlight", auto_id="homespotlight", control_type="Custom")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | Button - 'Xbox Game Studios sale. Save up to 75%. '    (L-1766, T354, R-612, B789)
   |    |    |    |    |    |    | ['Button9', 'Xbox Game Studios sale. Save up to 75%. ', 'Xbox Game Studios sale. Save up to 75%. Button']
   |    |    |    |    |    |    | child_window(title="Xbox Game Studios sale. Save up to 75%. ", auto_id="_mosaicSlot0", control_type="Button")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | Button - 'Best entertainment apps. Enjoy hit movies, TV amp; music—anytime, anywhere. '    (L-607, T354, R-226, B569)
   |    |    |    |    |    |    | ['Button10', 'Best entertainment apps. Enjoy hit movies, TV amp; music—anytime, anywhere. ', 'Best entertainment apps. Enjoy hit movies, TV amp; music—anytime, anywhere. Button']
   |    |    |    |    |    |    | child_window(title="Best entertainment apps. Enjoy hit movies, TV amp; music—anytime, anywhere. ", auto_id="_mosaicSlot1", control_type="Button")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | Button - 'Curated by Hispanic/Latinx communities. Games, movies, and TV curated by Hispanic/Latinx communities. '    (L-607, T574, R-226, B789)
   |    |    |    |    |    |    | ['Button11', 'Curated by Hispanic/Latinx communities. Games, movies, and TV curated by Hispanic/Latinx communities. Button', 'Curated by Hispanic/Latinx communities. Games, movies, and TV curated by Hispanic/Latinx communities. ']
   |    |    |    |    |    |    | child_window(title="Curated by Hispanic/Latinx communities. Games, movies, and TV curated by Hispanic/Latinx communities. ", auto_id="_mosaicSlot4", control_type="Button")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | Button - 'Microsoft 365. Make life more organized and secure.. Price $69.99.  . '    (L-1766, T794, R-1385, B1008)
   |    |    |    |    |    |    | ['Button12', 'Microsoft 365. Make life more organized and secure.. Price $69.99.  . Button', 'Microsoft 365. Make life more organized and secure.. Price $69.99.  . ']
   |    |    |    |    |    |    | child_window(title="Microsoft 365. Make life more organized and secure.. Price $69.99.  . ", auto_id="_mosaicSlot2", control_type="Button")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | Button - '100  games, including EA Play. Price $1.00.  . '    (L-1380, T794, R-999, B1008)
   |    |    |    |    |    |    | ['Button13', '100  games, including EA Play. Price $1.00.  . ', '100  games, including EA Play. Price $1.00.  . Button']
   |    |    |    |    |    |    | child_window(title="100  games, including EA Play. Price $1.00.  . ", auto_id="_mosaicSlot3", control_type="Button")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | Button - 'Watch the home premiere. They're dying to save the world. Price Starts at $24.99.  . '    (L-994, T794, R-612, B1008)
   |    |    |    |    |    |    | ['Button14', "Watch the home premiere. They're dying to save the world. Price Starts at $24.99.  . ", "Watch the home premiere. They're dying to save the world. Price Starts at $24.99.  . Button"]
   |    |    |    |    |    |    | child_window(title="Watch the home premiere. They're dying to save the world. Price Starts at $24.99.  . ", auto_id="_mosaicSlot5", control_type="Button")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | Button - 'Roblox. Explore the Twenty One Pilots Concert Experience. Price Free.  . '    (L-607, T794, R-226, B1008)
   |    |    |    |    |    |    | ['Button15', 'Roblox. Explore the Twenty One Pilots Concert Experience. Price Free.  . Button', 'Roblox. Explore the Twenty One Pilots Concert Experience. Price Free.  . ']
   |    |    |    |    |    |    | child_window(title="Roblox. Explore the Twenty One Pilots Concert Experience. Price Free.  . ", auto_id="_mosaicSlot6", control_type="Button")
   |    |    |    |    |    | 
   |    |    |    |    |    | Custom - ''    (L-1796, T1068, R-196, B1089)
   |    |    |    |    |    | ['Microsoft StoreCustom3', 'Custom4']
   |    |    |    |    |    | child_window(auto_id="coregames", control_type="Custom")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | Static - 'Essential Apps'    (L0, T0, R0, B0)
   |    |    |    |    |    |    | ['Static', 'Essential Apps', 'Essential AppsStatic', 'Static0', 'Static1']
   |    |    |    |    |    |    | child_window(title="Essential Apps", auto_id="SectionTitle", control_type="Text")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | Static - 'Take your Windows experience to new heights with these must-have apps'    (L0, T0, R0, B0)
   |    |    |    |    |    |    | ['Take your Windows experience to new heights with these must-have apps', 'Static2', 'Take your Windows experience to new heights with these must-have appsStatic']
   |    |    |    |    |    |    | child_window(title="Take your Windows experience to new heights with these must-have apps", auto_id="SubscriptionDescription", control_type="Text")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | Button - 'Get more info Essential Apps'    (L0, T0, R0, B0)
   |    |    |    |    |    |    | ['Button16', 'Get more info Essential AppsButton', 'Get more info Essential Apps']
   |    |    |    |    |    |    | child_window(title="Get more info Essential Apps", auto_id="SubscriptionLearnMoreButton", control_type="Button")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | Hyperlink - 'Show all  Essential Apps'    (L0, T0, R0, B0)
   |    |    |    |    |    |    | ['Show all  Essential AppsHyperlink', 'Show all  Essential Apps', 'Hyperlink', 'Hyperlink0', 'Hyperlink1']
   |    |    |    |    |    |    | child_window(title="Show all  Essential Apps", auto_id="SectionViewAllButton", control_type="Hyperlink")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | Pane - 'ThemedCollection'    (L0, T0, R0, B0)
   |    |    |    |    |    |    | ['ThemedCollectionPane', 'ThemedCollection', 'Pane3', 'ThemedCollectionPane0', 'ThemedCollectionPane1', 'ThemedCollection0', 'ThemedCollection1']
   |    |    |    |    |    |    | child_window(title="ThemedCollection", auto_id="ResponsiveTileList", control_type="Pane")
   |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    | Button - 'Netflix'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    | ['Button17', 'Netflix', 'NetflixButton']
   |    |    |    |    |    |    |    | child_window(title="Netflix", auto_id="9WZDNCRFJ3TJ", control_type="Button")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Image - ''    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Image', 'Image0', 'Image1']
   |    |    |    |    |    |    |    |    | child_window(auto_id="_image", control_type="Image")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Static - 'Free'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Free', 'Static3', 'FreeStatic', 'Free0', 'Free1', 'FreeStatic0', 'FreeStatic1']
   |    |    |    |    |    |    |    |    | child_window(title="Free", auto_id="_pricing", control_type="Text")
   |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    | Button - 'Spotify Music'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    | ['Button18', 'Spotify Music', 'Spotify MusicButton']
   |    |    |    |    |    |    |    | child_window(title="Spotify Music", auto_id="9NCBCSZSJRSB", control_type="Button")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Image - ''    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Image2']
   |    |    |    |    |    |    |    |    | child_window(auto_id="_image", control_type="Image")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Static - 'Free'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Free2', 'Static4', 'FreeStatic2']
   |    |    |    |    |    |    |    |    | child_window(title="Free", auto_id="_pricing", control_type="Text")
   |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    | Button - 'Pinterest'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    | ['Button19', 'Pinterest', 'PinterestButton']
   |    |    |    |    |    |    |    | child_window(title="Pinterest", auto_id="9PFHDSF91B9R", control_type="Button")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Image - ''    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Image3']
   |    |    |    |    |    |    |    |    | child_window(auto_id="_image", control_type="Image")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Static - 'Free'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Free3', 'Static5', 'FreeStatic3']
   |    |    |    |    |    |    |    |    | child_window(title="Free", auto_id="_pricing", control_type="Text")
   |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    | Button - 'Adobe Lightroom'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    | ['Button20', 'Adobe LightroomButton', 'Adobe Lightroom']
   |    |    |    |    |    |    |    | child_window(title="Adobe Lightroom", auto_id="9PNLG4ZG0XGJ", control_type="Button")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Image - ''    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Image4']
   |    |    |    |    |    |    |    |    | child_window(auto_id="_image", control_type="Image")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Static - 'Free'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Free4', 'Static6', 'FreeStatic4']
   |    |    |    |    |    |    |    |    | child_window(title="Free", auto_id="_pricing", control_type="Text")
   |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    | Button - 'Drawboard PDF - Read, edit, annotate PDF'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    | ['Button21', 'Drawboard PDF - Read, edit, annotate PDF', 'Drawboard PDF - Read, edit, annotate PDFButton']
   |    |    |    |    |    |    |    | child_window(title="Drawboard PDF - Read, edit, annotate PDF", auto_id="9WZDNCRFHWQT", control_type="Button")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Image - ''    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Image5']
   |    |    |    |    |    |    |    |    | child_window(auto_id="_image", control_type="Image")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Static - 'Free'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Free5', 'Static7', 'FreeStatic5']
   |    |    |    |    |    |    |    |    | child_window(title="Free", auto_id="_pricing", control_type="Text")
   |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    | Button - 'Hotspot Shield Free VPN'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    | ['Button22', 'Hotspot Shield Free VPN', 'Hotspot Shield Free VPNButton']
   |    |    |    |    |    |    |    | child_window(title="Hotspot Shield Free VPN", auto_id="9WZDNCRDFNG7", control_type="Button")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Image - ''    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Image6']
   |    |    |    |    |    |    |    |    | child_window(auto_id="_image", control_type="Image")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Static - 'Free'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Free6', 'Static8', 'FreeStatic6']
   |    |    |    |    |    |    |    |    | child_window(title="Free", auto_id="_pricing", control_type="Text")
   |    |    |    |    |    | 
   |    |    |    |    |    | Custom - ''    (L0, T0, R0, B0)
   |    |    |    |    |    | ['Custom5']
   |    |    |    |    |    | child_window(auto_id="casualgames", control_type="Custom")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | Static - 'Featured free games'    (L0, T0, R0, B0)
   |    |    |    |    |    |    | ['Static9', 'Featured free gamesStatic', 'Featured free games']
   |    |    |    |    |    |    | child_window(title="Featured free games", auto_id="SectionTitle", control_type="Text")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | Static - 'Explore free fun to play games and find a new favorite.'    (L0, T0, R0, B0)
   |    |    |    |    |    |    | ['Explore free fun to play games and find a new favorite.', 'Explore free fun to play games and find a new favorite.Static', 'Static10']
   |    |    |    |    |    |    | child_window(title="Explore free fun to play games and find a new favorite.", auto_id="SubscriptionDescription", control_type="Text")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | Button - 'Get more info Featured free games'    (L0, T0, R0, B0)
   |    |    |    |    |    |    | ['Button23', 'Get more info Featured free gamesButton', 'Get more info Featured free games']
   |    |    |    |    |    |    | child_window(title="Get more info Featured free games", auto_id="SubscriptionLearnMoreButton", control_type="Button")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | Hyperlink - 'Show all  Featured free games'    (L0, T0, R0, B0)
   |    |    |    |    |    |    | ['Show all  Featured free gamesHyperlink', 'Hyperlink2', 'Show all  Featured free games']
   |    |    |    |    |    |    | child_window(title="Show all  Featured free games", auto_id="SectionViewAllButton", control_type="Hyperlink")
   |    |    |    |    |    |    | 
   |    |    |    |    |    |    | Pane - 'ThemedCollection'    (L0, T0, R0, B0)
   |    |    |    |    |    |    | ['ThemedCollectionPane2', 'ThemedCollection2', 'Pane4']
   |    |    |    |    |    |    | child_window(title="ThemedCollection", auto_id="ResponsiveTileList", control_type="Pane")
   |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    | Button - 'Goodgame Big Farm'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    | ['Button24', 'Goodgame Big Farm', 'Goodgame Big FarmButton']
   |    |    |    |    |    |    |    | child_window(title="Goodgame Big Farm", auto_id="9P6WRDS31JH8", control_type="Button")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Image - ''    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Image7']
   |    |    |    |    |    |    |    |    | child_window(auto_id="_image", control_type="Image")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Static - 'Free'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Free7', 'Static11', 'FreeStatic7']
   |    |    |    |    |    |    |    |    | child_window(title="Free", auto_id="_pricing", control_type="Text")
   |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    | Button - 'SuperCity: build, decorate and make friends!'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    | ['Button25', 'SuperCity: build, decorate and make friends!Button', 'SuperCity: build, decorate and make friends!']
   |    |    |    |    |    |    |    | child_window(title="SuperCity: build, decorate and make friends!", auto_id="9N3S17GLND23", control_type="Button")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Image - ''    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Image8']
   |    |    |    |    |    |    |    |    | child_window(auto_id="_image", control_type="Image")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Static - 'Free'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Free8', 'Static12', 'FreeStatic8']
   |    |    |    |    |    |    |    |    | child_window(title="Free", auto_id="_pricing", control_type="Text")
   |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    | Button - 'Imperia Online: The Great People'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    | ['Button26', 'Imperia Online: The Great PeopleButton', 'Imperia Online: The Great People']
   |    |    |    |    |    |    |    | child_window(title="Imperia Online: The Great People", auto_id="9NBLGGH30876", control_type="Button")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Image - ''    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Image9']
   |    |    |    |    |    |    |    |    | child_window(auto_id="_image", control_type="Image")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Static - 'Free'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Free9', 'Static13', 'FreeStatic9']
   |    |    |    |    |    |    |    |    | child_window(title="Free", auto_id="_pricing", control_type="Text")
   |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    | Button - 'Asphalt 9: Legends'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    | ['Button27', 'Asphalt 9: Legends', 'Asphalt 9: LegendsButton']
   |    |    |    |    |    |    |    | child_window(title="Asphalt 9: Legends", auto_id="9NZQPT0MWTD0", control_type="Button")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Image - ''    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Image10']
   |    |    |    |    |    |    |    |    | child_window(auto_id="_image", control_type="Image")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Static - 'Free'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Free10', 'Static14', 'FreeStatic10']
   |    |    |    |    |    |    |    |    | child_window(title="Free", auto_id="_pricing", control_type="Text")
   |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    | Button - 'Roblox'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    | ['Button28', 'Roblox', 'RobloxButton']
   |    |    |    |    |    |    |    | child_window(title="Roblox", auto_id="9NBLGGGZM6WM", control_type="Button")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Image - ''    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Image11']
   |    |    |    |    |    |    |    |    | child_window(auto_id="_image", control_type="Image")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Static - 'Free'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Free11', 'Static15', 'FreeStatic11']
   |    |    |    |    |    |    |    |    | child_window(title="Free", auto_id="_pricing", control_type="Text")
   |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    | Button - 'Goodgame Empire'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    | ['Button29', 'Goodgame Empire', 'Goodgame EmpireButton']
   |    |    |    |    |    |    |    | child_window(title="Goodgame Empire", auto_id="9NN1X4X530F5", control_type="Button")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Image - ''    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Image12']
   |    |    |    |    |    |    |    |    | child_window(auto_id="_image", control_type="Image")
   |    |    |    |    |    |    |    |    | 
   |    |    |    |    |    |    |    |    | Static - 'Free'    (L0, T0, R0, B0)
   |    |    |    |    |    |    |    |    | ['Free12', 'Static16', 'FreeStatic12']
   |    |    |    |    |    |    |    |    | child_window(title="Free", auto_id="_pricing", control_type="Text")
   |    |    |    |    |    | 
   |    |    |    |    |    | ScrollBar - 'Vertical'    (L0, T0, R0, B0)
   |    |    |    |    |    | ['Vertical', 'VerticalScrollBar', 'ScrollBar']
   |    |    |    |    |    | child_window(title="Vertical", auto_id="VerticalScrollBar", control_type="ScrollBar")
   |    | 
   |    | Static - 'Microsoft Store'    (L-1781, T262, R-211, B287)
   |    | ['Microsoft Store4', 'Static17', 'Microsoft StoreStatic']
   |    | child_window(title="Microsoft Store", auto_id="StoreTitle", control_type="Text")
   | 
   | Pane - ''    (L-1796, T294, R-196, B1089)
   | ['Pane5', 'Microsoft StorePane3']
 

Мой вопрос в том, как мне проанализировать эти вложенные меню с помощью pywinauto, не повторяя каждое из них повторно??

Если бы кто-нибудь мог пролить свет на то, как перемещаться по этим модификаторам управления, я бы любил тебя вечно. Примеры блокнота и примеры из документов, которые мне трудно перевести в приложение Microsoft Store, и я просто чувствую себя очень глупо