Jump to content

open internet explore and open a webpage


boltc
 Share

Recommended Posts

i want to open a webpage and go to a page

i did this befor\

Run("C:\Program Files\Internet Explorer\iexplore.exe", "", @SW_MAXIMIZE)Sleep(2000)Send('{f6}')Send('www.google.com')is there an easyer way to do this?


            
        

        

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


BigDod
            
            
                Posted 
                
            
        
    
    
        


BigDod
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Jokers
                
                    
                
            
            
                
                    
                        
                            
                                
                            
                                 7.3k
                            
                                
                            
                        
                        
                    
                
            
            
                

    
    
        
RIP: The Mayor of Mirth
    
    

            
        
    
    
        



    
        
            
                
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            Posted 
            
            
                
                    (edited)
                
                
            
        
    

    

    

    
        
        
            All I did was search the forum for browser and got
$url = "enter the url here..."
Run(@Comspec & " /c start " & $url)
Edited by BigDod


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

  • 2 weeks later...

Use this to open your webpage:

run( "C:\Program Files\Internet Explorer\IEXPLORE.EXE -new http://www.google.com","")

The key to this line is the "-new" switch, which will open IE in a new window. Enjoy!

;)

I've been using that alot lately but one question I was wondering about and have had a hard time get working is a func to wait for the page to load before continuing. I use sleep right now but sometimes pages don't load in the time i gave it. It would be nice to have it run after the page is loaded. any ideas?

Link to comment
Share on other sites

Using IE.au3 (see my sig) and the AutoIt beta, the following will open a webpage and will wait for the webpage load to be fully completed before returning control back to your script:

#include <IE.au3>
$oIE = _IECreate()
_IENavigate($oIE, "http://www.google.com")

Dale

I've been using that alot lately but one question I was wondering about and have had a hard time get working is a func to wait for the page to load before continuing. I use sleep right now but sometimes pages don't load in the time i gave it. It would be nice to have it run after the page is loaded. any ideas?

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

I tried it but i can not get it to work. I d/l ie.au3 and put it into includes folder. from that thread and switch my defs to Beta v3.1.1.76

I get this error when try to run

C:\Program Files\AutoIt3\Include\IE.au3(1,1) : ERROR: syntax error

<

^

C:\Program Files\AutoIt3\Include\IE.au3(281,84) : ERROR: syntax error (illegal character)

If StringInStr($o_window.document.title, $s_string) > 0 Then

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(281,84) : ERROR: multi-line 'If' missing 'Then'.

If StringInStr($o_window.document.title, $s_string) > 0 Then

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(284,21) : ERROR: missing EndSelect.

EndIf

~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(279,19) : REF: missing EndSelect.

Select

~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(285,17) : ERROR: syntax error

Case

~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(286,81) : ERROR: syntax error

If StringInStr($o_window.LocationURL, $s_string) > 0 Then

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(286,81) : ERROR: multi-line 'If' missing 'Then'.

If StringInStr($o_window.LocationURL, $s_string) > 0 Then

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(289,21) : ERROR: syntax error

EndIf

~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(291,93) : ERROR: syntax error

If StringInStr($o_window.document.body.innerText, $s_string) > 0 Then

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(291,93) : ERROR: multi-line 'If' missing 'Then'.

If StringInStr($o_window.document.body.innerText, $s_string) > 0 Then

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(294,21) : ERROR: syntax error

EndIf

~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(296,93) : ERROR: syntax error

If StringInStr($o_window.document.body.innerHTML, $s_string) > 0 Then

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(296,93) : ERROR: multi-line 'If' missing 'Then'.

If StringInStr($o_window.document.body.innerHTML, $s_string) > 0 Then

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(299,21) : ERROR: syntax error

EndIf

~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(304,13) : ERROR: syntax error

EndSelect

~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(542,118) : ERROR: syntax error

$linkText = $link.outerText & "" ; Append empty string to prevent problem with no outerText (image) links

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(575,78) : ERROR: syntax error

if ($i_index >= 0) and ($i_index <= $doc.links.length - 1) Then

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(575,78) : ERROR: unbalanced paranthesis expression.

if ($i_index >= 0) and ($i_index <= $doc.links.length - 1) Then

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(575,78) : ERROR: multi-line 'If' missing 'Then'.

if ($i_index >= 0) and ($i_index <= $doc.links.length - 1) Then

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(584,5) : ERROR: syntax error

Else

~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(587,5) : ERROR: syntax error

EndIf

~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(1101,57) : ERROR: syntax error

If $i_col > $i_cols Then $i_cols = $i_col

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(1101,57) : ERROR: multi-line 'If' missing 'Then'.

If $i_col > $i_cols Then $i_cols = $i_col

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(1239,113) : ERROR: syntax error

While ($o_object.document.readyState <> "complete") and ($o_object.document.readyState <> 4)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(1239,113) : ERROR: unbalanced paranthesis expression.

While ($o_object.document.readyState <> "complete") and ($o_object.document.readyState <> 4)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(1447,1) : ERROR: syntax error

<

^

C:\Program Files\AutoIt3\Include\IE.au3(278,39) : ERROR: ObjName(): undefined function.

If (ObjName($o_window.document)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Kaso\Desktop\webtest.au3 - 27 error(s), 0 warning(s)

heres the exact code i have in scite

#include <IE.au3>
$oIE = _IECreate()
_IENavigate($oIE, "http://www.google.com")
send("test")

I'm used to using a func like func("title","whatever",whatever")

Is this code of yours supposed to be the same?

Link to comment
Share on other sites

It would appear that your download of IE.au3 went badly. Please right-click on the link to it and choose "Save as...". I'm guessing that it opened as text in your browser and you then saved it to disk.

Based on the error message about the ObjName function it also looks like you are not actually running the latest beta -- if your're using SciTe, make certain you use Alt-F5 instead of F5 alone to run the code or it will not use the beta when it runs.

Dale

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

I have done as you said and all is much better. Although i get this error in the log at the bottom. heres my script as a test

#include <ie.au3>
$oIE = _IECreate()
_IENavigate($oIE, "http://www.google.com")

C:\Program Files\AutoIt3\Include\ie.au3 (776) : ==> Unable to parse line.:

If IsObj($o_object.elements) Then

If IsObj($o_object.e^ ERROR

I am really new with the program, using these UDFs. what am i doing wrong?

Link to comment
Share on other sites

It would still appear that there is something wrong with your IE.au3 download. I'm guessing that you would get the same error in a script that had nothing but the #include <IE.au3>

I'd suggest that you delete all copies of IE.au3 from your system and do the download again making certain that everything goes smoothly.

Dale

I have done as you said and all is much better. Although i get this error in the log at the bottom. heres my script as a test

#include <ie.au3>
$oIE = _IECreate()
_IENavigate($oIE, "http://www.google.com")

C:\Program Files\AutoIt3\Include\ie.au3 (776) : ==> Unable to parse line.:

If IsObj($o_object.elements) Then

If IsObj($o_object.e^ ERROR

I am really new with the program, using these UDFs. what am i doing wrong?

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

I can't believe how difficult this is ;) OK heres what I've done. I've installed SciTe4AutoIt3.exe, SciTe4Au3Upd.exe and AutoIT3_UDF_Update_3.1.0.exe. My defs are set to 3.1.1.76 beta. I have right clicked and saved the IE.au3 from the first post in your sig. Says there is 1000+ d/ls of it. IE.au3 is saved to c:\program files\autoit3\include

using this script as a test, should put in the word test in the google search after its loaded.

#include <IE.au3>
$oIE = _IECreate()
_IENavigate($oIE, "http://www.google.com")
send("test")

if I hit F5 alone i get this.

C:\Program Files\AutoIt3\Include\IE.au3(275,39) : ERROR: ObjName(): undefined function.

If (ObjName($o_window.document)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\username\Desktop\webload.au3 - 1 error(s), 0 warning(s)

if I hit alt+f5 I get this

>"C:\Program Files\AutoIt3\SciTe\CompileAU3\CompileAU3.exe" /run /beta /ErrorStdOut /in "C:\Documents and Settings\username\Desktop\webload.au3" /autoit3dir "C:\Program Files\AutoIt3\beta" /UserParams

>Running AU3Check...C:\Program Files\AutoIt3\SciTe\Defs\Unstable\Au3Check\au3check.dat

>AU3Check Ended. No Error(s).

>Running: (3.1.1.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\z361\Desktop\webload.au3"

C:\Program Files\AutoIt3\Include\IE.au3 (776) : ==> Unable to parse line.:

If IsObj($o_object.elements) Then

If IsObj($o_object.e^ ERROR

>AutoIT3.exe ended.

>Exit code: 0 Time: 0.702

I am at my cpu at work now too so I know its not PC related. only 1 copy of ie.au3 on this one. I have also tried F5 and alt+f5 in IE.au3 only and I get the same message. Am I d/l it from the wrong spot?

Edited by Kaso
Link to comment
Share on other sites

Running: (3.1.1.0):C:\Program Files\AutoIt3\autoit3.exe

Now that you've included more of the SciTe console output you'll see that you are not in fact running the Beta when you execute with Alt-F5. It should reference 3.1.1.63 or higher for this to work.

I'm a little surprised that IE.au3 doesn't give you an error prior to line 776, but it certainly won't work with 3.1.1.0

Please go to the Downloads section, Beta at the bottom of the page, AutoIt and install the most recent beta on top of what you already have. Make certain the the new version number is reflected in the SciTe output when you run with Alt-F5.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Ahhhhh now it works Woot :P NOOB I am ;)

Thanks. I tell you if it wasn't for the support of people like yourself this program would not be where it is today. A program is only as strong as the community that supports it. thanks again

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...