how to get current google tab in python 1

how to get current google tab in python

from pywinauto import Application # import pywinauto
app = Application(backend='uia')
app.connect(title_re=".*Chrome.*")
element_name="Address and search bar"
dlg = app.top_window()

url = dlg.child_window(title=element_name, control_type="Edit").get_value() # get url from database
print(url)# print url
# -/\-/\-/\-/\-/\-/\-*** HAPPY CODING ***-/\-/\-/\-/\-/\-/\-/\-

Here is what the above code is Doing:
1. Importing the pywinauto module
2. Creating an application object
3. Connecting to the application
4. Getting the top window
5. Getting the value of the address bar
6. Printing the value

Similar Posts