Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OLE Error
Message
 
 
To
09/04/2012 14:26:30
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01540706
Message ID:
01540708
Views:
63
After Navigate you have to wait for navigation to complete before you can use results.
See http://www.berezniker.com/content/pages/visual-foxpro/view-pdf-vfp-form
Look for code after '* Wait for PDF to load'

>I've been picking a this code off and on for a few days. The line where the error occurs is commented. If I press ignore, it cycles once and stops in the same place. URLs are being opened okay.
>So, I am missing something.
>
>
>SET DEFAULT TO c:\netscrape
>CLEAR
>CLOSE TABLES all
>PUBLIC TheText, emotion1,emotion2,foundthreat, lolink, lcurl, lcOutput
>TheText = " "
>emotion1 = " "
>emotion2 = " "
>foundthreat = " "
>loLINK = " "
>lcURL = " "
>lcOutput = " "
>********************************
>USE seedurls IN 1
>USE popthreats IN 2 && pop = global population
>USE popresults IN 3
>SELECT seedurls
>SCAN && Outer loop scan
>	IF TYPE('lox')#'O'
>		lox=CREATEOBJECT('internetexplorer.application')
>	ENDIF
>	lox.VISIBLE=.F.
>	lcURL = seed &&location
>	lcURL = ALLTRIM(TRANSFORM(lcURL))
>	lnTime = 1000 && = 10 SECOND
>	lox.NAVIGATE(lcURL)
>	lox.VISIBLE=.F.
>	WAIT 'Navigating!' WINDOW NOWAIT
>********************************
>		FOR EACH loLink IN lox.DOCUMENT.Links  && Go to each referenced sub page - Error occurs here [OLE ERROR code 0x80004005 unspecified error]
>		lcOutPut = [ ] + loLink.Href + [ ] + loLink.innerText
>		lox.NAVIGATE(lcOutput)
>		lcOutput =  lox.DOCUMENT.body.innerText && Get href site text  && .
>		TheText = lcOutput
>**************
>		SELECT popthreats
>		SCAN && Processing for individual href pages
>			IF ALLTRIM(popthreats.threat) $ TheText
>				TheWord = ALLTRIM(popthreats.threat)
>				WordLength = LEN(popthreats.threat)
>				nStartPosition = AT(ALLTRIM(popthreats.threat), TheText)  && AT(cSearchExpression, cExpressionSearched [, nOccurrence])
>				foundthreat = SUBSTR(TheText, nStartPosition, WordLength) && SUBSTR(cExpression, nStartPosition [, nCharactersReturned])
>				emotion1 = SUBSTR(TheText, (nStartPosition-21), 20) && Back up 21 characters and select the next 20 letters.
>				emotion2 = SUBSTR(TheText, WordLength, 20) && Go to the last letter in FoundThreat and take the next 20 letters.
>				SELECT popresults
>				APPEND BLANK
>				REPLACE emo1 WITH emotion1
>				REPLACE threat WITH foundthreat
>				REPLACE emo2 WITH emotion2
>				SELECT popthreats
>			ENDIF
>		ENDSCAN && End processing loop
>		SELECT seedurls
>**************
>		ENDFOR && Code must be inside the FOREACH loop to access all the href pages
>	RELEASE lox && Close this site and open a new seed URL
>ENDSCAN && End outer loop scan
>CLOSE TABLES ALL
>*************************
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform