Followers 0

# open internet explore and open a webpage

## 13 posts in this topic

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?

Share on other sites

BigDod

505

The Mayor of Mirth

Jokers

505

7,316 posts

#2 ·
Posted October 4, 2005

(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

Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

##### Share on other sites

#3 ·  Posted (edited)

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!

Edited by vollyman

##### Share on other sites

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?

##### Share on other sites

WinWait ( "title of page" )

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

##### 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

Automate input type=file (Related)

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

##### 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?

##### Share on other sites

#8 ·  Posted (edited)

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

Automate input type=file (Related)

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

##### 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?

##### 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

Automate input type=file (Related)

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

##### Share on other sites

#11 ·  Posted (edited)

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

##### 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

Automate input type=file (Related)

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

##### Share on other sites

Ahhhhh now it works Woot 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