Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: sigit prasetyo
  
 indonesia
 
 sigit prasetyo
 Tags
Subject: RE: how to grab html link on webbrowser ?
Thread ID: 315918 Message ID: 315947 # Views: 44 # Ratings: 1
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Tuesday, August 09, 2011 8:37:14 PM         
   


> hello friend
> i try to grab html source code using webbrowser.document
> i have a source code but from visual basic
> can anybody translate it to me ?
> in visual basic :
> Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
> Dim HTMLdoc As HTMLDocument
> Dim HTMLlinks As HTMLAnchorElement
> Dim STRtxt As String
>
> If LBLANGKA.Caption = "1" Then
> On Error Resume Next
> Set HTMLdoc = WebBrowser1.Document
> For Each HTMLlinks In HTMLdoc.links
> STRtxt = STRtxt & HTMLlinks.href
> TXTARAHURL.Text = STRtxt
> Exit Sub
> Next HTMLlinks
> End If
>
> how implemetation that code in foxpro?
> or anybody have other code in foxpro 9.0 ?
>
> thx u

local oForm
oForm = newobject('HTMLViewerForm')

with oForm.htmlviewer
  .navigate2("http://www.microsoft.com")
  DO WHILE .ReadyState != 4
  ENDDO
  CREATE CURSOR documentLinks (description m, linkURL m)
  FOR EACH oLink IN .document.Links
  	INSERT INTO documentLinks VALUES (oLink.innerHTML, oLink.href)
  endfor
endwith
oForm = .null.
RELEASE oForm
SELECT DocumentLinks
locate
BROWSE

define class HTMLViewerForm as form
  height = 500
  width = 800
  add object htmlviewer as olecontrol with ;
    height = 500, width = 800, visible = .t., ;
    oleclass = 'Shell.Explorer'

  procedure htmlviewer.refresh
    nodefault
  endproc
enddefine


Cetin Basoz

.Net has got better.Think about moving - check my blog:
My Blog
Blog (mirror) - sounds to be down

COMPLETE THREAD

how to grab html link on webbrowser ? Posted by sigit prasetyo @ 8/9/2011 4:26:46 PM
RE: how to grab html link on webbrowser ? Posted by Vladimir Zografski @ 8/9/2011 7:26:19 PM
RE: how to grab html link on webbrowser ? Posted by sigit prasetyo @ 8/9/2011 8:16:53 PM
RE: how to grab html link on webbrowser ? Posted by Cetin Basoz @ 8/9/2011 8:37:14 PM
RE: how to grab html link on webbrowser ? Posted by sigit prasetyo @ 8/10/2011 3:22:46 AM