>search on the following....
>
>"RE: VFP8: Screen Scrape"

I'd forgotten I wrote that <s~>

and it raises a couple of interesting points about screen scraping:
the code worked when I wrote it, but doesn't now - for two reasons:

   the target site has changed slightly

   amongst other things this means you end up at a 'redirected default'
page - one of the ms security patches (I think) results in http post
commands being rejected by such pages. Try this:

cURL = "http://www.hawthornecottage.com/andy/"; && your url here
oHttp = createobject("Microsoft.XmlHttp")
oHttp.Open("POST", cURL, .F.) && Synchronous
? oHttp.Send("")
gcc= oHttp.ResponseText
n1= AT([NAME="Graphic2"],gcc) && you do
n2=AT('ALT=',SUBSTR(gcc,n1)) && a lot of
n3=AT('" ', SUBSTR(gcc,n1+n2)) && this stuff
?ALLTRIM(SUBSTR(gcc, n1+n2+3, n3-2)) && when screen scraping
ohttp.abort
ohttp=null
CLOSE ALL
CLEAR ALL
RELEASE ALL

Now try the same thing but using "http://andy.hawthornecottage.com"; *which
goes to the same page*
- it fails and you get a 405 error

P.S.

If anyone wants to try scraping using the dom (with xml - or html come to
that) then as a guide here is some more stuff I posted earlier:

CLEAR
cURL = "http://www.hawthorn-cottage.com/iptry1.asp"; && your url here
oHttp = createobject("Microsoft.XmlHttp")
oHttp.Open("POST", cURL, .F.) && Synchronous
oHttp.Send("")
cX = oHttp.responseText
cY=SUBSTR(cX,AT([<body>],cX)+6,AT([</body>],cX)-AT([<body>],cX)-6)
cZ=CHRTRAN(cY,CHR(9)+CHR(10)+CHR(13),' ')
cZ = ALLTRIM(cZ)
?cZ && REMOTE = you
cURL = "http://www.hawthorn-cottage.com/iptryDOM.asp"; && your url here
oHttp.Open("POST", cURL, .F.) && Synchronous
oHttp.Send("")
oX = oHttp.responseXML
?oX.getElementsByTagName('txt').item(0).text && REMOTE = you
?oX.getElementsByTagName('txt').item(1).text && LOCAL = web server
?oX.getElementsByTagName('txt').item(2).text && = web server name
?ohttp.abort
CLOSE ALL
RELEASE ALL

Andrew Davies  MBCS CITP
  - AndyD        8-)#


**********************************************************************

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this email in error please notify the system manager.

This footnote also confirms that this email message has been swept by 
MIMEsweeper for the presence of computer viruses.

Please contact [EMAIL PROTECTED] with any queries.

**********************************************************************



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to