Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

open internet explore and open a webpage


  • Please log in to reply
12 replies to this topic

#1 boltc

boltc

    Adventurer

  • Active Members
  • PipPip
  • 103 posts

Posted 04 October 2005 - 01:01 PM

i want to open a webpage and go to a page

i did this befor\
[code=auto:0]
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?







#2 BigDod

BigDod

    The Mayor of Mirth

  • Jokers
  • 8,623 posts

Posted 04 October 2005 - 01:53 PM

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

Edited by BigDod, 04 October 2005 - 01:53 PM.

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

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


#3 DarthCookieMonster

DarthCookieMonster

    I ate your mom's cookie. Nom Nom Nom...

  • MVPs
  • 11,898 posts

Posted 04 October 2005 - 02:43 PM

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, 04 October 2005 - 02:45 PM.

The Vollatran project
_____


msg-108-0-96549500-1409901790.png
Obi didn't believe me when I told him the dark side has milk and cookies....


#4 Kaso

Kaso

    Seeker

  • Active Members
  • 37 posts

Posted 15 October 2005 - 11:52 PM

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?

#5 theguy0000

theguy0000

    Benevolent Dictator

  • Active Members
  • PipPipPipPipPipPip
  • 3,750 posts

Posted 16 October 2005 - 12:30 AM

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

#6 DaleHohm

DaleHohm

    Think of IE as an API...

  • MVPs
  • 5,981 posts

Posted 16 October 2005 - 04:16 AM

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, "<a href='http://www.google.com' class='bbc_url' title='External link' rel='nofollow external'>http://www.google.com"</a>)


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


#7 Kaso

Kaso

    Seeker

  • Active Members
  • 37 posts

Posted 16 October 2005 - 12:00 PM

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, "<a href='http://www.google.com' class='bbc_url' title='External link' rel='nofollow external'>http://www.google.com"</a>) send("test")


I'm used to using a func like func("title","whatever",whatever")
Is this code of yours supposed to be the same?

#8 DaleHohm

DaleHohm

    Think of IE as an API...

  • MVPs
  • 5,981 posts

Posted 16 October 2005 - 12:11 PM

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, 16 October 2005 - 12:15 PM.

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


#9 Kaso

Kaso

    Seeker

  • Active Members
  • 37 posts

Posted 17 October 2005 - 03:19 AM

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, "<a href='http://www.google.com' class='bbc_url' title='External link' rel='nofollow external'>http://www.google.com"</a>)


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?

#10 DaleHohm

DaleHohm

    Think of IE as an API...

  • MVPs
  • 5,981 posts

Posted 17 October 2005 - 03:56 AM

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, "<a href='http://www.google.com' class='bbc_url' title='External link' rel='nofollow external'>http://www.google.com"</a>)


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


#11 Kaso

Kaso

    Seeker

  • Active Members
  • 37 posts

Posted 17 October 2005 - 12:54 PM

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, "<a href='http://www.google.com' class='bbc_url' title='External link' rel='nofollow external'>http://www.google.com"</a>) 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, 17 October 2005 - 12:57 PM.


#12 DaleHohm

DaleHohm

    Think of IE as an API...

  • MVPs
  • 5,981 posts

Posted 17 October 2005 - 03:13 PM

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


#13 Kaso

Kaso

    Seeker

  • Active Members
  • 37 posts

Posted 17 October 2005 - 11:02 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users