Search code examples
pythontimemultithreadingpamie

win32com and PAMIE web page open timeout


currently im making some crawler script,
one of problem is sometimes if i open webpage with PAMIE,webpage can't open and hang forever.
are there any method to close PAMIE's IE or win32com's IE ?
such like if webpage didn't response or loading complete less than 10sec or so .
thanks in advance


Solution

  • Just use, to initialize your PAMIE instance, PAMIE(timeOut=100) or whatever. The units of measure for timeOut are "tenths of a second" (!); the default is 3000 (300 seconds, i.e., 5 minutes); with 300 as I suggested, you'd time out after 10 seconds as you request.

    (You can pass the timeOut= parameter even when you're initializing with a URL, but in that case the timeout will only be active after the initial navigation).