acer20006 Posted November 4, 2009 Posted November 4, 2009 HII ALL i have problem with IE all i need is to open ie and go to url _ and check if this site are available or not i can open ie and > if available then msgbox (0,"site", " www.google.com") > if not available the msgbox (0,"site" , " invalid link ") i try many codes but no one work for me (checking url ) _____
Manjish Posted November 4, 2009 Posted November 4, 2009 check IECreate() in Help file. [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
DaleHohm Posted November 4, 2009 Posted November 4, 2009 You may want to then look at _IEBodyReadText to check to see if the page contains what you expect it to. 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
acer20006 Posted November 4, 2009 Author Posted November 4, 2009 check IECreate() in Help file.i checked it before and make simple script but it doesn't work _ seterror doesn't work well it cant identify the the site name
acer20006 Posted November 4, 2009 Author Posted November 4, 2009 this a script i found at site expandcollapse popup#include-once #include <IE.au3> #include <GUIConstants.au3> #include <GUIConstantsEx.au3> ;not sure if this needs to be included #include <WindowsConstants.au3>;not sure if this needs to be included Global $oIE , $GUI $Link = InputBox("Rapid Share Captcha" , "Insert Rapid-Share Link" , "" , "" , 300 , 20) If Not @error = 0 Then Exit ElseIf StringInStr($Link , "RapidShare.com") Then _Create() Else MsgBox(0 , "" , "your link does seem to be valid") EndIf Func _Create() $oIE = _IECreateEmbedded() $GUI = GUICreate("Rapid Share Captcha", 800, 600 , Default , Default , $WS_POPUP) $GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 800, 600) GUISetState() ToolTip("attempting to connect to rapidshare." , 0 , 0 , "Please Wait...") _IENavigate($oIE, $Link , 1) ToolTip("") WinWaitActive($GUI) _FreeClick() While 1 Sleep(1000) WEnd EndFunc Func _FreeClick() $oButton = _IEGetObjByName($oIE, "dl.start" , 1) _IEAction($oButton, "Click") _IELoadWait($oIE) _WaitTime() EndFunc Func _WaitTime() $test = _IEBodyReadText($oIE) ;_StringBetween("Download ticket reserved.") _HappyTime() EndFunc Func _HappyTime() _IELoadWait($oIE) $Happy = _IEBodyReadText($oIE) If StringInStr($Happy , "The RapidShare Happy Hours are active right now. Have fun!") Then _Download() Else ; _Captcha() EndIf EndFunc Func _Download() $FindButton = _IEBodyReadText($oIE) If StringInStr($FindButton , "Download via") Then ; $oButton = _IEGetObjByName($oIE, "Download via Cogent" , 1) ; _IEAction($oButton, "Click") ; _IELoadWait($oIE) Else MsgBox(0 , "Error" , "can't find download button") EndIf EndFunc script take url and open ie butit cant identify if the link at rapedshare are available or not >> i wann to make the same idea but with msgbox
acer20006 Posted November 4, 2009 Author Posted November 4, 2009 You may want to then look at _IEBodyReadText to check to see if the page contains what you expect it to.Dale_IEBodyReadText useful function _ but i need it to work with the site name thx dale
DaleHohm Posted November 4, 2009 Posted November 4, 2009 Showing someone else's (seemingly random) code does not help you. Show what you have tried, describe your trouble and ask specific questions about it. It is not clear exactly what you mean by "site name", but also take a look at _IEPropertyGet($oIE, "title") 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
acer20006 Posted November 4, 2009 Author Posted November 4, 2009 (edited) you are rught dale it doesnt help this a simple code from my script #include <IE.au3> $oIE = _IECreate ("about:blank") Sleep(5000) _IENavigate ($oIE, "http://www.google.com" , 1) If @error Then MsgBox(0,"site" , " invalid link ") Else MsgBox(0,"site", " www.google.com") EndIf problem is if i change (http://www.google.com) to a link from any hosting site like rapedshare.com and .. i wann my script to check if my link are dead or not it's stuck _ it didnt show any error msg << the idea it's like link checker _ that's all >> Edited November 4, 2009 by acer20006
DaleHohm Posted November 4, 2009 Posted November 4, 2009 Please read helpfile for _IENavigate:RemarksThis function always returns a value of -1. This is because the navigate method has no useful return value and therefore nothing can be implied from it. You will need to employ other methods to determine success or failure of the navigation.This is not a problem with IE.au3, this is the way the DOM works.This is why I made the other suggestions about _IEBodyReadText and _IEPropertyGetDale 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
acer20006 Posted November 4, 2009 Author Posted November 4, 2009 (edited) thx dale for help _ i read help file ----------------------------- _IENavigate > This function always returns a value of -1 i waste alot of my time in it & i dont know how to compile it with other function _ im a loser _ ---------------------------- wil i try other function _ StringInStr _( geting script from help) but the this script also had problem #include <IE.au3> $oIE = _IECreate("http://rapidshare.com/files/27530939/T0120421.rar.html") $sMyString = "Error" $oLinks = _IELinkGetCollection($oIE) For $oLink in $oLinks $sLinkText = _IEPropertyGet($oLink, "innerText") If StringInStr($sLinkText, $sMyString) Then MsgBox(0,"","") EndIf Next i try to find the problem from help file but i cant figure it out >>>> all i need from my script is if he find ( error ) word pop up msgbox <<< Edited November 4, 2009 by acer20006
DaleHohm Posted November 4, 2009 Posted November 4, 2009 Why are you looking at links? Error is not a link on that page. Use _IEBodyReadText as I suggested before and look for "The file could not be found. Please check the download link." 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
acer20006 Posted November 4, 2009 Author Posted November 4, 2009 >>> msgbox will not popup #include <IE.au3> $oIE = _IECreate("http://rapidshare.com/files/27530939/T0120421.rar.html") $sText = _IEBodyReadText ($oIE) MsgBox(0, "Body Text", $sText) $word = "The file could not be found. Please check the download link." If StringInStr($sText, $word) Then MsgBox(0,"","") EndIf ------------------ msgbox will popup #include <IE.au3> $oIE = _IECreate("http://rapidshare.com/files/27530939/T0120421.rar.html") $sText = _IEBodyReadText ($oIE) MsgBox(0, "Body Text", $sText) $word = "msgbox will popup" If StringInStr($sText, $word) Then MsgBox(0,"","") EndIf ------------------ it's simple somehow but i can modify it to suit my script -------------- thx dale for help
DaleHohm Posted November 4, 2009 Posted November 4, 2009 Works for me: #include <IE.au3> $oIE = _IECreate("http://rapidshare.com/files/27530939/T0120421.rar.html") $sText = _IEBodyReadText ($oIE) If StringInStr($sText, "The file could not be found. Please check the download link.") Then MsgBox(0,"Yes","Found It") Else MsgBox(0,"No","Didn't find it") EndIf 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now