Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6597541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:13:22+00:00 2026-05-25T18:13:22+00:00

Is there a way to programmatically obtain a list of open tabs in a

  • 0

Is there a way to programmatically obtain a list of open tabs in a browser by index?

For example, suppose Google Chrome is open with two tabs.
In the program, a line something like:

tabs_list = list_tabs(hwnd)

…where hwnd is the handle to the window for the overall Chrome instance and tabs_list is a dictionary something like:

{
  0 : 'http://stackoverflow.com/',
  1 : 'http://www.otherstufff.com/'
}

(…or maybe by title of the window instead of url)

If so, then bringing focus to one of them can be possible from the Python script with keyboard commands, control- (CTRL-) like control-1 or control-2.


An edit added later to try to help clarify: Picture a local wxPython app, where you already know how to activate a given instance of Chrome on that same box from within your wxPython app running locally, and that browser instance has multiple tabs open, and now you want to insure that a certain tab has focus, to be able to interact with that web page that is being displayed (maybe using CTRL-A CTRL-C for example to harvest its content). This question is not about issuing keyboard commands, that is already known, the question is how to obtain a list of open tabs, if possible, thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:13:23+00:00Added an answer on May 25, 2026 at 6:13 pm

    While not sure of your target OS, you can do this on Mac OS X:

    >>> from appscript import *
    >>> map(lambda x: x.title(), app('Google Chrome').windows[0].tabs())
    [u'Stack Overflow', u'Google']
    

    On Windows, you will want to look into OLE Automation with Python.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to programmatically enable Javascript in Blackberry Browser? In my application
Is there any way to programmatically tell android to open the keyboard when the
In an android Activity is there a way to programmatically list the it has
Is there a way to programmatically check if an Android device is running Google
Is there a way to programmatically list all geo-tagged Wikipedia entries within a radius
Is there a way to programmatically pause my Chrome extension from all of it's
Is there a way to programmatically get a list of instances of a type
Is there a way to programmatically list all available content providers on a device?
Is there a way to programmatically force a Python script to drop into a
Is there a way to programmatically detect whether the microphone is on on Windows?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.