Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Control eh?
Message
De
08/11/2010 11:23:23
 
 
À
05/11/2010 07:45:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01488307
Message ID:
01488528
Vues:
107
>>>The KEYBOARD command puts keystrokes into VFP buffer. An ActiveX control wouldn't see them. What are you trying to accomplish?
>>>
>>>
>>>>The first two lines of code below work fine. I am not sure why the displayed website is not being selected by the CTRL A. Have I blundered?
>>>>
>>>>THIS._Webbrowser41.NAVIGATE2('http://www.google.com')
>>>>
>>>>THISFORM.REFRESH
>>>>
>>>>KEYBOARD"{CTRL+A}"
>>
>>I am trying to capture the text from a web page and eventually write it to a memo field
>
>Hey Grady. I created a web page called w1.htm in folder c:\demos, with the source (note the spaces after < and before > are intentional, so I can embed the HTML source in a UT post).
>
>< html >
>< body >
>< input id="test" type="text" >
>< /body >
>< /html >
>
>Below is sample code you can try by executing line by line in the Command Window, which opens that web page above, sets the value of the text field (in case you want to know how to read/write to the value of fields), and then sets cHTML to the entire HTML of the web page.
>
>o=NEWOBJECT("_webform",HOME()+"gallery\_webview")
>o.Show
>o.oleWebBrowser.Navigate2("c:\demos\w1.htm")
>o.oleWebBrowser.document.getElementByID("test").innerText="Testing 123"
>cHTML=o.oleWebBrowser.document.body.outerHTML
>
>Tip. If you want to run VFP code to occur after a web page is loaded after calling Navigate2(), then put your event code in the NavigateComplete() event method of oleWebBrowser, which fires after the web page is full loaded into the IE web browser control.

Ken

* Thank you for the VFP tip above. It's really handy
* I am having success loading the first website in FORM.INIT
* and then in webbrowser41 NAVIGATECOMPLETE2
#define OLECMDID_SELECTALL 17
THIS.ExecWB(OLECMDID_SELECTALL, 0) && Thank you Boris

* I'll expand on it today

* Web interaction is definately a cool way to program. Even for a geezer, such as me :))
I ain't skeert of nuttin eh?
Yikes! What was that?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform