title: How to Return the URL of the Active Chrome Tab?
body: <p>I tried using the following code to get the URL of the current Chrome tab:</p>
  <pre><code>from pywinauto import Application
  
  app = Application(backend='uia')
  app.connect(title_re=&quot;.*Chrome.*&quot;)
  element_name=&quot;Address and search bar&quot;
  dlg = app.top_window()
  url = &quot;http://&quot;+dlg.child_window(title=element_name, control_type=&quot;Edit&quot;).get_value()
  </code></pre>
  <p>However, it only works when there is only one Chrome instance.
  When I open a second Chrome, the above codes can't return the correct URL (it still gets the URL of the first Chrome, even though it's no longer the active app).</p>
  <p>How can I get the URL of the active tab of the actual active Chrome?</p>
  <p>If it's not possible, codes to return all URLs of all Chrome instances can also work for my purpose.
  Thanks.</p>