help me to open google chrome then click a link

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
SlowPoison
Newbie
Posts: 6
Joined: Tue Aug 17, 2010 5:04 am

help me to open google chrome then click a link

Post by SlowPoison » Tue Aug 17, 2010 5:07 am

i want 2 do this thing,
open google chrome then after 5 seconds it will click a link "Continue"
how 2 do that????

SlowPoison
Newbie
Posts: 6
Joined: Tue Aug 17, 2010 5:04 am

Post by SlowPoison » Wed Aug 18, 2010 6:25 am

i really need help. plz any1 help :(

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Aug 18, 2010 9:14 am

Does this have to be done in Chrome? Only it is much easier to automate IE as it can be done via VBScript or WebRecorder transparently via IE's COM interface and Documemt Object Model.

However, if the link URL of the "Continue" link never changes you could simply navigate to it.

Really to help you we'd need to see the page. Can you send the URL of the page and show us which link needs to be "Clicked"?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

SlowPoison
Newbie
Posts: 6
Joined: Tue Aug 17, 2010 5:04 am

Post by SlowPoison » Wed Aug 18, 2010 4:35 pm

here is the url the link in the text continue always changes . tell me how to do it. i m newbie in codes.
http://mobitop.org/top/in.php?sid=4122[/url]

SlowPoison
Newbie
Posts: 6
Joined: Tue Aug 17, 2010 5:04 am

Post by SlowPoison » Wed Aug 18, 2010 5:40 pm

it can be done in any browsers

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Aug 19, 2010 12:33 pm

Here you go. This does it via IE:

Code: Select all

//Set up some VBS functions for use later
VBSTART
Dim IE

Sub CreateIE
  Set IE = CreateObject("InternetExplorer.Application")
  IE.Visible=1
End Sub

Sub Navigate(URL)
  IE.Navigate URL
End Sub

Sub WaitBusy
  do while IE.Busy
  loop
End Sub

Sub KillIE
  IE.Quit
  Set IE = nothing
End Sub

Sub ClickLink(text)
  Dim FormNr
  Dim ItemNr
  Dim TheForm

  Dim anchors
  Set anchors = IE.document.All.Tags("A")
  
  if anchors.Length = 0 then
    MsgBox("No anchors found in page")
  else
    for AnchorNr = 0 to anchors.Length - 1
      Set TheAnchor = anchors(AnchorNr)
      if TheAnchor.innertext = text then
          TheAnchor.Click
        exit for
      end if
    next
  end if
End Sub

VBEND

//Do the business .....

VBRun>CreateIE

//Focus the new IE window
VBEval>IE.Hwnd,ie_handle
Let>WIN_USEHANDLE=1
SetFocus>ie_handle
Let>WIN_USEHANDLE=0

VBRun>Navigate,http://mobitop.org/top/in.php?sid=4122

VBRun>WaitBusy
Wait>1

VBRun>ClickLink,Continue

VBRun>WaitBusy
Wait>1
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

SlowPoison
Newbie
Posts: 6
Joined: Tue Aug 17, 2010 5:04 am

Post by SlowPoison » Thu Aug 19, 2010 7:07 pm

thanx a lot bro. its working f9

SlowPoison
Newbie
Posts: 6
Joined: Tue Aug 17, 2010 5:04 am

Post by SlowPoison » Fri Aug 20, 2010 6:39 am

bro,
now how to click this button
http://waptops.com/in.php

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Aug 20, 2010 8:45 am

Have a look at the code I sent, and the source of the html of the page with the button and you should be able to figure it out for yourself.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

vishal gaurav
Newbie
Posts: 1
Joined: Thu May 25, 2017 7:17 am

Re: help me to open google chrome then click a link

Post by vishal gaurav » Thu May 25, 2017 7:33 am

I want to get table data from money control website. http://www.moneycontrol.com/financials/ ... results/IT. I want to use google chrome to open this link and then click on previous years link and get that table too along with the table on that page. I need to click previous years as the url even after clicking previous years remains the same and I cannot directly navigate to it. It is easy with internet explorer but I cannot use it.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts