Results 1 to 2 of 2

Thread: Looking for comparable namespaces of Awesomium

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2004
    Posts
    259

    Looking for comparable namespaces of Awesomium

    looking for the equivalent of the webbrowser namespaces/functions/properties/events in awesomium :


    .Document

    .DocumentText (for use with webbrowser.documenttext.contains("string") )

    .GetElementById("ElementID as String).InnerText

    .GetElementById("ElementID as String").InvokeMember("click")

    .Document.Forms

    for example:

    Code:
         If DidMarketLogin = False Or DidSearchLogin = False Then
        
                        If MarketSearchList.Document IsNot Nothing Then
                            If MarketSearchList.DocumentText.Contains("LOGIN EXPIRED") Then
                              DidMarketLogin = True
                              MarketSearchList.Document.GetElementById("username").InnerText = LoginForm.LoginText.Text
                              'This will type in the login text")
                              MarketSearchList.Document.GetElementById("password").InnerText = LoginForm.PasswordText.Text
                              MarketSearchList.Document.GetElementById("free").InvokeMember("click")
                            Else
                                DidMarketLogin = True
                            End If
        
                        End If
                    End If
    ..

    i also need the proper way to handle when navigating is triggered.
    eg:

    WebBrowser1.Navigating

    such as:
    Code:
         Private Sub MarketSearchList_Navigating(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatingEventArgs) Handles WebBrowser1.Navigating
                If InStr(LCase(e.Url.ToString()), "go:") Then
                    'here i cancel the event and let my app use the information from the link
                    e.Cancel = True
                    ProcessSounds(" AYE ")
                    MakeGo(e.Url.ToString())
                    Exit Sub
                End If
                If InStr(e.Url.ToString(), "waxystudios.com") = 0 Then
                    ' I'm trying here to cancel the event so that the WebBrowser1 
                    ' control doesn't go there.
                    ' instead i let their default browser navigate to the site.
                    e.Cancel = True
                    ProcessSounds(" AYE ")
                    System.Diagnostics.Process.Start(getDefaultBrowser(), e.Url.ToString())
                Else
                    'let the webcontrol navigate. don't interrupt it.
                    e.Cancel = False
                End IF
            End Sub
    any information, or links to the relevant docs, would be appreciated.
    ----------------------------------------------------

    Missing the days of GWBasic 1.1
    WaxyStudios.com

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Looking for comparable namespaces of Awesomium

    looking for the equivalent of the webbrowser namespaces/functions/properties/events in awesomium
    For most of these there are none, for reasons which will become apparent shortly but .PageContents = .DocumentText

    The rest of the functions you require are dealt with in Javascript (where, frankly, they really belong!) So a typical log-in would look like this ...

    vb.net Code:
    1. Private Sub WebControl1_LoadCompleted(sender As Object, e As System.EventArgs) Handles awc.LoadCompleted
    2.         awc.ExecuteJavascript("document.getElementById('user').value=""****"";document.getElementById('pass').value=""****"";document.getElementById('login_submit').click()")
    3.     End Sub
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

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