Page 2 of 2 <12
Topic Options
#114040 - 2004-02-15 04:10 AM Re: Fetching HTML from a Form Feed?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Maybe they're also filtering the HTTP headers to ferret out invalid requests e.g. via browsertype or similar.
_________________________
There are two types of vessels, submarines and targets.

Top
#114041 - 2004-02-15 05:13 AM Re: Fetching HTML from a Form Feed?
Skatterbrainz Offline
Starting to like KiXtart

Registered: 2002-10-17
Posts: 172
Loc: Virginia, USA
I don't know. I copied their search form page to my laptop and cleaned out everything but what I posted earlier. It works fine. Trying the cache and cookie thing didn't seem to make a difference. Nor did trying it from a previously unused machine. Just curious, does the "send" method for xmlhttp send as though it's a form collection object or as though it is a GET request?
_________________________
silence is golden, but duct tape is silver

Top
#114042 - 2004-02-15 05:18 AM Re: Fetching HTML from a Form Feed?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
if you read the code I pasted, it clearly says POST.
like the http and html specs do say, there is only 2 types of requests.
and with the code you are using the post one.
forms can use both.

but I must no quess there is something else too in that webpage that you mistakenly left out or didn't notice to have significance.
_________________________
!

download KiXnet

Top
#114043 - 2004-02-15 05:05 PM Re: Fetching HTML from a Form Feed?
Skatterbrainz Offline
Starting to like KiXtart

Registered: 2002-10-17
Posts: 172
Loc: Virginia, USA
I wasn't doubting you at all, only asking a question out of curiosity. I apologize for dragging this on. I posted everything I have in my form page. I cannot post the ASP target page because I do not have access to the server or the source code. It may be that they are indeed doing more on their end than I am aware of. All I know is that I can send a form entry from my own form page and their ASP page accepts it and returns the desired output. When I try to call the page using script code it fails to return the desired result. I think I'm done trying for now. Thanks for all your help.
_________________________
silence is golden, but duct tape is silver

Top
#114044 - 2004-02-15 09:47 PM Re: Fetching HTML from a Form Feed?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, doh.
sure, but like said before, the things like cookies and browser checks and alike are things that can affect.
if you said you did with clean machine did it have cookies disabled?
did you try with other browsers?

anyway, your only ways are to either search for the problem, or ask them.

btw, they also might check for referring page.
if so, they have specifically disabled automating the process.
_________________________
!

download KiXnet

Top
#114045 - 2004-02-16 01:27 AM Re: Fetching HTML from a Form Feed?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
However, then you can start spoofing heder variables, e.g.
Code:

$web.setRequestHeader = "Referer", "http://url.to.com/emp.html"


might work, however, according to http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q178066& it would not. YMMV

This might also help: http://www.webmasterworld.com/forum24/396.htm
_________________________
There are two types of vessels, submarines and targets.

Top
#114046 - 2004-02-16 03:48 PM Re: Fetching HTML from a Form Feed?
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Here is an old-school method, controlling the IE object.

The $sGT weirdness is just to get around posting problems.

Don't forget to change the form URL to the real comany name:


Break On

; vim600: ai sw=3 ts=3

$sGT="<"

; Form HTML
$sHTML=''+$sGT+'HTML>'
+' '+$sGT+'HEAD>'+$sGT+'TITLE>Employee User Name List'+$sGT+'/TITLE>'+$sGT+'/HEAD>'
+' '+$sGT+'BODY BGCOLOR="#B2BCE9">'+$sGT+'FONT FACE="ARIAL,HELVETICA">'
+' '+$sGT+'H3>Employee Standard User Name List'+$sGT+'/H3>'
+' '+$sGT+'b>'
+' '+$sGT+'FONT FACE="Comic Sans MS" SIZE=2 COLOR=black>'
+' '+$sGT+'P> '
+' '+$sGT+'FORM Name=frmEmpInfo METHOD="POST" ACTION="http://intranet.mycompany.com/empinfo.asp">'
+' Employee #:'
+' '+$sGT+'INPUT Name=empno SIZE="12">'
+' '+$sGT+'/FORM>'
+' '+$sGT+'/FONT>'
+' '+$sGT+'/BODY>'
+''+$sGT+'/HTML>'

; Create Internet Explorer object
$oIE = CreateObject("InternetExplorer.Application")

; The following lines tidy up the screen a bit, giving a semi-kiosk mode.
$oIE.toolbar=0
$oIE.addressbar=0
$oIE.statusbar=0

$oIE.Navigate("about:blank")
; Wait for page to stop loading...
While $oIE.busy AND $oIE.readystate <> 4 AND @ERROR = 0 Loop
$oDoc=$oIE.document

; Now, add the starting form...
$oDoc.Write($sHTML)
While $oIE.busy AND $oIE.readystate <> 4 AND @ERROR = 0 Loop

; Comment out the next line if you don't want the form to appear (stealth mode)
$oIE.Visible=1

; The next line "autofills" the employee field.
; Note, we could just as well have coded the value in the HTML above, but this
; is an example of how to do control the form from within KiXtart
$oDoc.frmEmpInfo.empno.value="12345"

; This sleep not required - it's just here to give the viewer an opportunity
; to see what is going on.
Sleep 2

; Here is the magic - submit the form.
$oDoc.frmEmpInfo.submit()

; And wait for it to refresh...
While $oIE.busy AND $oIE.readystate <> 4 AND @ERROR = 0 Loop

; Uncomment the next two line to close IE and clean up.
;$oIE.quit()
;$oIE=0



Top
Page 2 of 2 <12


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 928 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.058 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org