open internet explore and open a webpage
#1
Posted 04 October 2005 - 01:01 PM
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
Posted 04 October 2005 - 01:53 PM
$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 HereAutoIt 1-2-3 by Valuater - A great starting point.
#3
Posted 04 October 2005 - 02:43 PM
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.
#4
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
Posted 16 October 2005 - 12:30 AM
#6
Posted 16 October 2005 - 04:16 AM
#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?
#7
Posted 16 October 2005 - 12:00 PM
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
Posted 16 October 2005 - 12:11 PM
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.
#9
Posted 17 October 2005 - 03:19 AM
#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
Posted 17 October 2005 - 03:56 AM
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?
#11
Posted 17 October 2005 - 12:54 PM
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
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
#13
Posted 17 October 2005 - 11:02 PM
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




