Jump to content
Sign in to follow this  
JReinn

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

Recommended Posts

JReinn

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

Share this post


Link to post
Share on other sites
TehWhale

#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 by TehWhale

Share this post


Link to post
Share on other sites
Cw2K1

#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.

Share this post


Link to post
Share on other sites
JReinn

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

Share this post


Link to post
Share on other sites
TehWhale

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

Share this post


Link to post
Share on other sites
JReinn

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:

Share this post


Link to post
Share on other sites
TehWhale

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:

Then maybe it needs time to load it. Or Youtube only updates the number of views per hour.

Share this post


Link to post
Share on other sites
JReinn

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

Share this post


Link to post
Share on other sites
DexterMorgan

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

Share this post


Link to post
Share on other sites
JReinn

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:

Share this post


Link to post
Share on other sites
DexterMorgan

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

Share this post


Link to post
Share on other sites
JReinn

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

Share this post


Link to post
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
Sign in to follow this  

×