SkysLastChance

Clicking link in IE table?

11 posts in this topic

#1 ·  Posted (edited)

I am trying to automate a simple task that just clicks a link and then marks it resolved and then goes to the next link if there is one. 

I am not sure how to click the link though. I believe it might be in a table. 

I am trying to click the idx="0">132561 however the "132561" number will always change.

Is it possible to click it if the number is always changing?

<td tabindex="-1" class="dojoxGridCell eventReferenceCell eventReferenceCell_1" role="gridcell" style="width: 81px;" unselectable="on" idx="0">132561</td>

This is the html code for the link I want to click

 

#include <IE.au3>


   $oIE = _IEAttach("Welcome to assyst")
   _IELinkClickByIndex($oIE, 0) ;Clicks top link to pick patient

 Here is what I tried

 

 

Edited by SkysLastChance
Clarification

Life's simple. You make choices and you don't look back.

Share this post


Link to post
Share on other sites



14 hours ago, SkysLastChance said:

I am trying to automate a simple task that just clicks a link and then marks it resolved and then goes to the next link if there is one. 

I am not sure how to click the link though. I believe it might be in a table. 

I am trying to click the idx="0">132561 however the "132561" number will always change.

Is it possible to click it if the number is always changing?

<td tabindex="-1" class="dojoxGridCell eventReferenceCell eventReferenceCell_1" role="gridcell" style="width: 81px;" unselectable="on" idx="0">132561</td>

This is the html code for the link I want to click

 

#include <IE.au3>


   $oIE = _IEAttach("Welcome to assyst")
   _IELinkClickByIndex($oIE, 0) ;Clicks top link to pick patient

 Here is what I tried

 

 

_IETagNameGetCollection

Returns a collection object of all elements in the object with the specified TagName or a single element by index

 

1 person likes this

Share this post


Link to post
Share on other sites

Thank you for the response. 

#include <IE.au3>
#include <MsgBoxConstants.au3>

Local $oIE = _IEAttach("Welcome to assyst")
Local $oInputs = _IETagNameGetCollection($oIE, "input")
Local $sTxt = ""
For $oInput In $oInputs
    $sTxt &= $oInput.type & @CRLF
Next
MsgBox($MB_SYSTEMMODAL, "Form Input Type", "Form: " & $oInput.form.name & @CRLF & @CRLF & "         Types :" & @CRLF & $sTxt)

This is what I used

 

 

Attached is what I got after running the script

 

This is what I got.PNG


Life's simple. You make choices and you don't look back.

Share this post


Link to post
Share on other sites

You have too many of those - you will need to narrow it down. Could you post a larger portion of the html code? Go one level up!

Share this post


Link to post
Share on other sites

Thank you for the response. Here is some more of the code.

morecode.PNG


Life's simple. You make choices and you don't look back.

Share this post


Link to post
Share on other sites

Bump


Life's simple. You make choices and you don't look back.

Share this post


Link to post
Share on other sites

It's difficult to provide suggestions with the limited information that you've provided. What type of website is this? Can you provide a URL or attach a file containing the complete HTML?

Share this post


Link to post
Share on other sites

I was wondering about that.  Is there a recomoned way to pull all the code off of a site? or any sugestions? I am just not 100% sure on how to do it so it is actually legiable. 


Life's simple. You make choices and you don't look back.

Share this post


Link to post
Share on other sites

Have you tried File > Save As?

Share this post


Link to post
Share on other sites

Try to identify it by .IDX = 0. I see that the other have different IDX values.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

On 17.12.2016 at 5:17 AM, Danp2 said:

Have you tried File > Save As?

SaveAs from the IE Menu  not always is saving entire document content (especially when it is https:\\).
The better soultions is to use _IEDocReadHTML  +  FileWrite

 

Edited by mLipok
1 person likes this

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2017-06-04

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