From: John Date: 2002-07-17T06:46:45+09:00 Subject: Re: Win32OLE: Is getting MSIE HTTP status possible? "Dossy" wrote in message news:20020716180059.GN2284@panoptic.com... > On 2002.07.17, John wrote: > > > > I think its kinda strange to use Ruby to do this, but to each his own. > > What do you recommend? > > > For further questions regarding IE/automation I would recommend going to an > > IE/vbcript newsgroup. > > Thanks. Can you recommend one? > > > That said, the following vbscript code does what you want: > > > > set oHTTP = CreateObject ("msxml2.XMLHTTP") > > > > oHTTP.open "GET", "http://www.yahoo.com/", false > > oHTTP.send sRequest > > > > Wscript.echo "Status = " & oHTTP.status > > Rem Wscript.echo oHTTP.responseText > > > > It uses the msxml component. I did not have a sample for how to do this > > with the internet explorer control per se. That information, if it exists, > > will be available by asking in an IE programming newsgroup. > > I know how to perform an HTTP request and get the status. I know > how to automate and control IE via COM. What I don't know is how > to get the status from IE via COM. > > I don't want to hit every URL twice -- once to get the status and > a second time to test via automated IE. > > -- Dossy > > -- > Dossy Shiobara mail: dossy@panoptic.com > Panoptic Computer Network web: http://www.panoptic.com/ > "He realized the fastest way to change is to laugh at your own > folly -- then you can let go and quickly move on." (p. 70) > > I would have assumed that you would use vbscript/jscript from windows script host before Ruby. It doesn't make a lot of difference. I sure would prefer to use Ruby where possible :-). I don't go to these groups, but from their titles they would be a good place to start: microsoft.public.scripting.vbscript microsoft.public.inetexplorer.scripting I don't think that you can get the status code from the IE COM object. That is why I gave a different sample. I assume you want the IE object model which is why you would then need to do 2 requests. If you find a way to do this at a different group would you mind responding to this thread with the answer? John.