Results 1 to 8 of 8

Thread: WebBrowser Object

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Location
    Mesa, AZ, USA
    Posts
    16
    I am using the WebBrowser object in vb6.
    When a link is clicked on a web page, I need to retrieve information from the ahref link. Is this possible??

    Example:

    <a href="http://www.blah.com/index.html" target="main">


    I need to retrieve the 'target = main'.

    If anyone can help....i'd appreciate it.


    lata


    dubi


  2. #2
    Member
    Join Date
    Feb 1999
    Location
    ,Mo,USA
    Posts
    36
    Hey- I dont think you can directly detect it in vb without some complex subclassing, but in the webbrowsers BeforeNavigate2, it passes you the url and the headers and postdata of the page it is about to navigate to, so you can probably get what you want there.

    Thnx For Your Time,
    CarlosTheJackal

    [Edited by CarlosTheJackal on 04-13-2000 at 04:07 PM]

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Location
    Mesa, AZ, USA
    Posts
    16
    Thanks CarlosTheJackal. Ill give it a shot. Thanks for the fresh perspective.





    lata




    dubi

  4. #4
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264

    Cool

    Try this:

    Private Sub Command1_Click()
    Inet1.Execute ("www.whatever.com")
    End Sub

    Private Sub Inet1_StateChanged(ByVal State As Integer)
    If State = icResponseCompleted Then
    Do
    content = Inet1.GetChunk(1000)
    Text1.Text = Text1.Text + content
    Loop While content <> ""
    End If
    End Sub


    add microsoft internet transfer control to your form
    add a command button and a text box

    and cut and paste this code.

    you can through it into a variable, and than parse all the "target" ones.
    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Location
    Mesa, AZ, USA
    Posts
    16
    Hey thanks for the input asabi. One problem that I am still experiencing is........

    The directory window that will be used for navigation has a long list of hyperlinks. All of these links target "main". How do I differentiate between which hyperlink is clicked?
    Example....


    <a href="/corporate/corp1.html" target="main">Office Lobby</a><BR>
    <a href="/corporate/corp2.html" target="main">Press Room</a><BR>
    <a href="/corporate/corp3.html" target="main">Human Resources</a><BR>
    <a href="/corporate/corp4.html" target="main">Communications</a><BR>
    <a href="/corporate/corp5.html" target="main">Board Room</a><BR>
    <a href="/corporate/corp6.html" target="main">File Room</a><BR>


    If I attempt to retrieve the information via WebBrwoser1.locationURL --- It only gives me the URL to the directory. ie. "http://www.blah.com/directory.html"
    I need the actual URL to the hyperlink that is clicked.
    Any Ideas???? Thanks everyone for helping out with this. Ive been stumped for quite a few days now. Any advice is appreciated.


    lata



    dubi


  6. #6
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264

    Cool


    Let me understand, you want to make your own web browser ?? :-)

    The guy clicks on something, and you want to get the url that he clicked on before it goes there ?

    Alon
    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  7. #7
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264

    Cool

    I just thought about something:

    You can make a dynamic FORM that will populate buttons, each button will go to another link (the program builts it when the page loads), and than when someone presses the button, you can trap it !

    Tell me what you think / questions ..

    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Location
    Mesa, AZ, USA
    Posts
    16
    Ok...let me try n' clarify to make things a lil easier. I am creating a web browser for http://www.okid.com . If you go to this site and click on the top left corner of the homepage (Enter oKID Now). This will display a flash animation with a frameset on the left hand side. On the bottom of the frameset, click Directory. A new window is generated which contains a list of links. When I click on one of these links......I would like the page displayed inside the "main" frame of the original browser window. If I use the NewWindow2 Event and set my original browser as the newWindow....it blows out the frameset on the main browser. If I attempt force the navigation using BeforeNavigate2 Event......It sends the http://www.okid.com/directory.html into the browser (the page with all the links.) I think this is because the webbrowser1.locationURL is always http://www.okid.com/directory.html the link just uses an A HREF Tag to target the "main" frame.


    I hope this clears things up. Thanks very much for takin the time to look at this.



    dubi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width