Jump to content

How to create a simple and fast web-browser with autoit?


Recommended Posts

Straight from help

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Example()

; Simple example: Embedding an Internet Explorer Object inside an AutoIt GUI
;
; See also: http://msdn.microsoft.com/workshop/browser/webbrowser/reference/objects/internetexplorer.asp
Func Example()
    Local $oIE, $GUIActiveX, $GUI_Button_Back, $GUI_Button_Forward
    Local $GUI_Button_Home, $GUI_Button_Stop, $msg
    
    $oIE = ObjCreate("Shell.Explorer.2")

    ; Create a simple GUI for our output
    GUICreate("Embedded Web control Test", 640, 580, (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN))
    $GUIActiveX = GUICtrlCreateObj ($oIE, 10, 40, 600, 360)
    $GUI_Button_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30)
    $GUI_Button_Forward = GUICtrlCreateButton("Forward", 120, 420, 100, 30)
    $GUI_Button_Home = GUICtrlCreateButton("Home", 230, 420, 100, 30)
    $GUI_Button_Stop = GUICtrlCreateButton("Stop", 330, 420, 100, 30)

    GUISetState()       ;Show GUI

    $oIE.navigate("http://www.autoitscript.com")

    ; Waiting for user to close the window
    While 1
        $msg = GUIGetMsg()

        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $msg = $GUI_Button_Home
                $oIE.navigate("http://www.autoitscript.com")
            Case $msg = $GUI_Button_Back
                $oIE.GoBack
            Case $msg = $GUI_Button_Forward
                $oIE.GoForward
            Case $msg = $GUI_Button_Stop
                $oIE.Stop
        EndSelect
        
    WEnd

    GUIDelete()
EndFunc   ;==>Example

8)

NEWHeader1.png

Link to post
Share on other sites

Embedding internet explorer will not be any faster or slower than actually using Internet Explorer. All of the web browsers in Example Scripts work this way, with less functionality.

I don't want to use to embed the IE. :party:

I'd like to create my own simple webbrowser. :)

Is there no easy method to realize a webbroser based on autoit without embedding IE? :)

Link to post
Share on other sites

I think you underestimate how complex a simple web browser really is...

Complexity means compatibility! :)

I don't need complex compaibility to every website. :)

Plain HTML is what I need for my webbrowser-project. :lmao:

Is that possible to realize whith autoit? :party:

Link to post
Share on other sites

Complexity means compatibility! :)

I don't need complex compaibility to every website. :)

Plain HTML is what I need for my webbrowser-project. :lmao:

Is that possible to realize whith autoit? :party:

Well I think you must understand you will have to write an html / javascript / vbscript parser AND a rendering engine.

Link to post
Share on other sites

Well I think you must understand you will have to write an html / javascript / vbscript parser AND a rendering engine.

OK lets start at the beginning: HTML-parser! ^_^

javascript <- not necessary for version 1.0 :)

vbscipt <- not necessary for version 1.0 :)

rendering engine <- not necessary for version 1.0 :party:

How to start to write a HTML-parser with autoit? :lmao:

Link to post
Share on other sites

You must be insane. AutoIt lacks object-oriented goodness. Managing all of the possible parameters for HTML tags would be a nightmare with AutoIt.

Maybe start perusing the W3C reference for the HTML structure:

http://www.w3.org/html/wg/html5/

That ought to knock some sense into you.

OK now a have some sense for the stuff. :)

Looks like I don't need a complete parser.

What I need is to communicate with a webserver:

1) start communication

2) enter username

3) enter password

4) check that login was correct

Thats all. :lmao:

Can I make that without (embeded) IE?

I think I could realize that with TCP commands. :party:

Is that a way ? :)

Link to post
Share on other sites
  • 5 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...