Jump to content

IE.au3 : How to get status request (like Error 404)


Recommended Posts

Hi.

I work with IE.au3 and i need to know how i can check if the page is not a 404 error.

I can't use functions to read source and check if 404 is here or something like this cause i can have some pages where 'error 404' is written as text but are well loaded, so i want something more reliable, like read the HEAD of the Get request to see the real status of the request but i can't manage to find how with IE.au3

Thx for helping me,

Tim

Link to comment
Share on other sites

I think this should be possible by using the written by trancexx.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Ye it's easy to do it with WinHTTP UDF but my page must be load with IE and i don't want to load the same page with another GET request a second time.

Internet Explorer must have this header somewhere, just need to find where :o

Link to comment
Share on other sites

Then you need to dig into COM for IE.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

That's what i'm asking.

I'm on MSDN since this morning and i can't find this **** >_< , english difficult for me

Found referer and stuff like that http://msdn.microsoft.com/en-us/library/ms534365%28v=vs.85%29

But cant find the status.

If i look with a sniffer i can get it, for example :

HTTP/1.1 401 Authorization Required

Date: Thu, 05 Jul 2012 13:52:14 GMT

Server: Apache

WWW-Authenticate: Basic realm="Access to /logs"

Content-Length: 615

Keep-Alive: timeout=2, max=200

Connection: Keep-Alive

Content-Type: text/html

Edited by timmalos
Link to comment
Share on other sites

Seems to be impossible. Will need to do it with WinHTTP i guess.

There are some DOM properties which the browser determines by looking at the headers, but there isn't an over-arching HTTP Headers object that will contain all of the headers.

Thx for your answer !

Edit : But DebugBar - IE extension for web developer can do it for example. I just wonder how they manage to do it.

Even if the bar must be opened before the load of the page, they manage to intercept all the request response... would know how they do it.

Edited by timmalos
Link to comment
Share on other sites

I finally will use curl, only when i get errors. (Don't want to load 2 times each page)

curl --retry 1 --silent --no-sessionid -N -m 10 -H "Pragma: no-cache" --no-keepalive --tcp-nodelay --url 'https://authentification-cerbere.application.i2/authSAML/login/LogoffAction.do?domain=vide' -w %{http_code}:%{time_namelookup}:%{time_connect} -A Mozilla/5.0 -o curl.log

Returns Http_Code:Time_NameLookup:Time_connect

Edited by timmalos
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...