logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

RE: Screen scraping from VFP: msg#02240

db.foxpro.profox

Subject: RE: Screen scraping from VFP


>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 internet.administrators@xxxxxxxxxxxxxxxxx with any queries.

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



_______________________________________________
Post Messages to: ProFox@xxxxxxxxx
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.






Only community members can participate in forum threads. You must Register or log in to contribute.

<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo