Jump to content

Vist website, turn browser off, and do the thing again


JReinn
 Share

Recommended Posts

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 :mellow:

Edited by WinneR
Link to comment
Share on other sites

#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 by Cw2K1
Enjoy the complexity.Feel the power of simplicity.
Link to comment
Share on other sites

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
Oh thanks! :mellow:

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

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
How 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! :mellow:

#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 by TehWhale
Link to comment
Share on other sites

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")
Next
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 :mellow:

Link to comment
Share on other sites

Sorry for double posting, But could you share a code, that does this in Firefox, and not ie? Please :mellow:

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 by WinneR
Link to comment
Share on other sites

Sorry for double posting, But could you share a code, that does this in Firefox, and not ie? Please :mellow:

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

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! :mellow:

Link to comment
Share on other sites

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! :mellow:

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

  • 2 weeks later...

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.

#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 by WinneR
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...