JReinn Posted November 1, 2008 Share Posted November 1, 2008 (edited) I need a code that visits a website (Let's take Youtube as an example) Shows the page so you get a +1 on the view, shuts the site down, and repeats the whole thing again, as many times as I want it to... Can anybody help? Greatly appreciated Edited November 1, 2008 by WinneR Link to comment Share on other sites More sharing options...
TehWhale Posted November 1, 2008 Share Posted November 1, 2008 (edited) #include <IE.au3> $oIE = _IECreate() For $i = 1 To 5000; 5000 times _IENavigate($oIE, "www.youtube.com");Website _IENavigate($oIE, "about:blank") Next This will do what you want. Edited November 1, 2008 by TehWhale Link to comment Share on other sites More sharing options...
Cw2K1 Posted November 1, 2008 Share Posted November 1, 2008 (edited) #include <IE.au3> $oIE = _IECreate() For $i = 1 To 5000; 5000 times _IENavigate($oIE, "www.youtube.com");Website _IENavigate($oIE, "about:blank") Next This will do what you want.Improved #include <IE.au3> $oIE = _IECreate() For $i = 1 To 5000; 5000 times _IENavigate($oIE, "www.youtube.com");Website _IELoadWait ($oIE); wait for website to be loaded completely _IENavigate($oIE, "about:blank") Next Edited November 1, 2008 by Cw2K1 Enjoy the complexity.Feel the power of simplicity. Link to comment Share on other sites More sharing options...
JReinn Posted November 1, 2008 Author Share Posted November 1, 2008 Improved #include <IE.au3> $oIE = _IECreate() For $i = 1 To 5000; 5000 times _IENavigate($oIE, "www.youtube.com");Website _IELoadWait ($oIE); wait for website to be loaded completely _IENavigate($oIE, "about:blank") NextOh thanks! If it's not that much trouble, is there some way you could make something that pops up... wiht 2 textboxes, one with URL and second with the numbers of times to visit... Thanks! Link to comment Share on other sites More sharing options...
TehWhale Posted November 1, 2008 Share Posted November 1, 2008 (edited) Improved #include <IE.au3> $oIE = _IECreate() For $i = 1 To 5000; 5000 times _IENavigate($oIE, "www.youtube.com");Website _IELoadWait ($oIE); wait for website to be loaded completely _IENavigate($oIE, "about:blank") NextHow is that improved? The _IELoadWait() does nothing. _IENavigate returns after the page has loaded. If it's not that much trouble, is there some way you could make something that pops up... wiht 2 textboxes, one with URL and second with the numbers of times to visit... Thanks! #include <IE.au3> $oIE = _IECreate() For $i = 1 To 5000; 5000 times _IENavigate($oIE, "www.youtube.com");Website ToolTip("Page: " & "www.youtube.com Times Loaded: " & $i, 0, 0) _IENavigate($oIE, "about:blank") Next Edited November 1, 2008 by TehWhale Link to comment Share on other sites More sharing options...
JReinn Posted November 1, 2008 Author Share Posted November 1, 2008 How is that improved? The _IELoadWait() does nothing. _IENavigate returns after the page has loaded. #include <IE.au3> $oIE = _IECreate() For $i = 1 To 5000; 5000 times _IENavigate($oIE, "www.youtube.com");Website ToolTip("Page: " & "www.youtube.com Times Loaded: " & $i, 0, 0) _IENavigate($oIE, "about:blank") NextThanks for the code, it's nice... but, it doesn't make counts on videos on youtube... :/ Could you help me with improving this, thanks Link to comment Share on other sites More sharing options...
TehWhale Posted November 1, 2008 Share Posted November 1, 2008 Thanks for the code, it's nice... but, it doesn't make counts on videos on youtube... :/Could you help me with improving this, thanks Then maybe it needs time to load it. Or Youtube only updates the number of views per hour. Link to comment Share on other sites More sharing options...
JReinn Posted November 1, 2008 Author Share Posted November 1, 2008 (edited) Sorry for double posting, But could you share a code, that does this in Firefox, and not ie? Please It doesn't count visits with ie... Edit. Hmm it does count visits if you instead of typing the url again, you refresh the page... Edit. Edit. I tried to put 'Send("{f5}",1)' instead of the blank, but it still doesn't count visits... It does if I do it manually, can ANYONE help? PLEASE! :/ Edited November 1, 2008 by WinneR Link to comment Share on other sites More sharing options...
DexterMorgan Posted November 1, 2008 Share Posted November 1, 2008 Sorry for double posting, But could you share a code, that does this in Firefox, and not ie? Please It doesn't count visits with ie...Edit. Hmm it does count visits if you instead of typing the url again, you refresh the page...Edit. Edit. I tried to put 'Send("{f5}",1)' instead of the blank, but it still doesn't count visits... It does if I do it manually, can ANYONE help? PLEASE! :/maybe you can click on the refresh button with mouseclick() or controlclick() code Link to comment Share on other sites More sharing options...
Bert Posted November 1, 2008 Share Posted November 1, 2008 (edited) I wonder if he needs to dump any saved cookies between views... Edited November 1, 2008 by Volly The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
JReinn Posted November 2, 2008 Author Share Posted November 2, 2008 My code looks like this now, and it's working completely! #include <IE.au3> $oIE = _IECreate() For $i = 1 To 50; 50 times _IENavigate($oIE, "http://www.youtube.com");Website ToolTip("Page: " & "http://www.youtube.com Times Loaded: " & $i, 0, 0) Sleep(1000) MouseMove(359, 121,500) MouseClick("Left",359, 121, 1,500) Next Anyone that needs it, just copy! Link to comment Share on other sites More sharing options...
DexterMorgan Posted November 2, 2008 Share Posted November 2, 2008 My code looks like this now, and it's working completely! #include <IE.au3> $oIE = _IECreate() For $i = 1 To 50; 50 times _IENavigate($oIE, "http://www.youtube.com");Website ToolTip("Page: " & "http://www.youtube.com Times Loaded: " & $i, 0, 0) Sleep(1000) MouseMove(359, 121,500) MouseClick("Left",359, 121, 1,500) Next Anyone that needs it, just copy! My idea jk, you dont need mouse move you can use mouse click with the coords and it will work fine, if you want to do other stuff while it is clicking use control click code Link to comment Share on other sites More sharing options...
JReinn Posted November 16, 2008 Author Share Posted November 16, 2008 (edited) Hey, Thanks for all the response. The thing I wanted is fixed. Although I want to make the bot like this, so you can type your URL into input1 and it visits website, and input2 for how many times. My code looks like this, but it visits 3 instead of the url I need. It works if you do quotes, but not If I do with Input. expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <IE.au3> HotKeySet("{F8}",'Visit') #Region ### START Koda GUI section ### Form=d:\program files\autoit3\scite\koda\forms\winner_dk's website visit bot.kxf $Form1 = GUICreate("WinneR_DK's Website visit bot", 418, 192, 193, 125) $Input1 = GUICtrlCreateInput("http://www.Google.com/", 16, 32, 385, 21) $Label1 = GUICtrlCreateLabel("Website", 184, 8, 43, 17) $Label2 = GUICtrlCreateLabel("Visits", 192, 64, 28, 17) $Input2 = GUICtrlCreateInput("10", 160, 88, 97, 21) $Button1 = GUICtrlCreateButton("Visit Youtube.com!", 120, 160, 177, 25, 0) $Label4 = GUICtrlCreateLabel("F8 to visit the website!", 152, 112, 109, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $oIE = _IECreate() _IENavigate($oIE, "http://www.Youtube.com") EndSwitch WEnd Func Visit() $oIE = _IECreate() For $i = 1 To $Input2 _IENavigate($oIE, $Input1);Website ToolTip("Page: " & $Input1 & " Times Loaded: " & $i, 0, 1) Sleep(1000) Send("{F5}",0) Next EndFunc Edited November 16, 2008 by WinneR Link to comment Share on other sites More sharing options...
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