Sign in to follow this  
Followers 0
debkol35

is it possible to copy all specific links from a site and later open them randomly?

4 posts in this topic

#1 ·  Posted (edited)

Hi...

#include <IE.au3>
Local $oIE = _IECreate("www.google.com")
_IENavigate($oIE, "http://mysite.us")

after going to mysite.us, it will copy all links starts with " http://bit.ly/* " and after autoit will open all those links randomly?

is it possible? I am trying but failing to make it work :(

I have placed many bit.ly links in my site...Just want autoit to open them randomly then go back to my site, then open another bit.ly* link randomly !!

Edited by debkol35

Share this post


Link to post
Share on other sites



Can you please tells us what you try to achieve by randomly opening links?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi...

#include <IE.au3>
Local $oIE = _IECreate("www.google.com")
_IENavigate($oIE, "http://mysite.us")

after going to mysite.us, it will copy all links starts with " http://bit.ly/* " and after autoit will open all those links randomly?

is it possible? I am trying but failing to make it work :(

I have placed many bit.ly links in my site...Just want autoit to open them randomly then go back to my site, then open another bit.ly* link randomly !!

How is this different than your >other thread?

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Can you please tells us what you try to achieve by randomly opening links?

 

umm...I want to upload flash games on my site..and put those links in one place...later autoit will open each game links from that place then wait... and then go back to that place and will open different flash game link

How is this different than your >other thread?

 

umm..in that topic, links are limited to numbers, like link1, link2 but...I want to remove numbers... for example, I will upload more links in future, and autoit will open them too....I dont want to edit script everytime I upload links :(

-----------------------------------------

 

I made it this far...

#include <IE.au3>
Local $oIE = _IECreate("www.google.com")
_IENavigate($oIE, "http://mywebsite.us/")
_IELinkGetCollection($oIE)
Local $oLinks = _IELinkGetCollection($oIE)
Local $iNumLinks = @extended
MsgBox(0, "Link Info", $iNumLinks & " links found")

Last thing is happening, its collecting all 25 links. Now I need to open them randomly.... Please if someone helps me...I am trying hard but.. :(

-----------------------------------------------------

Ok I tried this method...but looks like its only opening the last link of the page every time :( ...I set 10 times loops...hoped it will open 10 different links in 10 times but its always opening the last link.. :(( where do I miss ? :(

#include <IE.au3>
Local $oIE = _IECreate("www.google.com")
Local $i = 0
Do
   $i = $i + 1
_IENavigate($oIE, "http://mypage.us/")
$oElements = _IETagNameGetCollection($oIE,"A")
$text = ""
For $oElement In $oElements
   StringRegExp($oElement.innerText, "Link")
   If not @error then $text = $oElement.innerText
Next
_IELinkClickByText($oIE,$text)
sleep(1000)
Until $i = 10

:- posting the solution if anyone needs in future :)

source:-

Local $oLinks = _IELinkGetCollection($oIE)
Local $iNumLinks = @extended
_IELinkClickByIndex($oIE, Random(0, $iNumLinks))
Edited by debkol35

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  
Followers 0