Jump to content
Sign in to follow this  
debkol35

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

Recommended Posts

debkol35

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
water

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


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Jos

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
debkol35

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  

×