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 430559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:53:14+00:00 2026-05-12T19:53:14+00:00

actually this is not hang status, i mean..it slow response, so in that case,

  • 0

actually this is not hang status, i mean..it slow response,
so in that case,
i would like to close IE and
want to restart from start.
so closing is no problem ,problem is ,how to set timeout ,for example if i set 15sec,
if not webpage open less than 15 sec i want to close it and restart from start.
is this possible to use with IE com interface?
really hard to find solution
Paul,

I’m used to follow code to check wether a webpage is completely open or not.
But as I mentioned, it is not working well, because IE.navigate is looks like it hangs or does not respond.

        while ie.ReadyState != 4: 
              time.sleep(0.5)
  • 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-12T19:53:15+00:00Added an answer on May 12, 2026 at 7:53 pm

    To avoid blocking problem use IE COM object in a thread.

    Here is a simple but powerful example demonstrating how can you use thread and IE com object together. You can improve it for your purpose.

    This example starts a thread a uses a queue to communicate with main thread, in main thread user can add urls to queue, and IE thread visits them one by one, after he finishes one url, IE visits next. As IE COM object is being used in a thread you need to call Coinitialize

    from threading import Thread
    from Queue import Queue
    from win32com.client import Dispatch
    import pythoncom
    import time
    
    class IEThread(Thread):
        def __init__(self):
            Thread.__init__(self)
            self.queue = Queue()
    
        def run(self):
            ie = None
            # as IE Com object will be used in thread, do CoInitialize
            pythoncom.CoInitialize()
            try:
                ie = Dispatch("InternetExplorer.Application")
                ie.Visible = 1
                while 1:
                    url = self.queue.get()
                    print "Visiting...",url
                    ie.Navigate(url)
                    while ie.Busy:
                        time.sleep(0.1)
            except Exception,e:
                print "Error in IEThread:",e
    
            if ie is not None:
                ie.Quit()
    
    
    ieThread = IEThread()
    ieThread.start()
    while 1:
        url = raw_input("enter url to visit:")
        if url == 'q':
            break
        ieThread.queue.put(url)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this not actually a developer question, but I am hoping that I
i have a very simple question, actually this is not the question, this is
Disclaimer: This is not actually a programming question, but I feel the audience on
For some reason, this code does not actually draw my bitmap file... or show
I'm not sure what this practice is actually called, so perhaps someone can edit
This deals with WordPress plugin development. Even if a user has not actually signed
I have an unavoidable situation that looks like this (simplified): FUNCTION_TO_CALL = y #
Suppose I have an SConstruct file that looks like this: env = Environment() env.Program(a,
I m Using a calendar.js file to implement calendar in my App. Actually this
I've actually solved this, but I'm posting it for posterity. I ran into a

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.