alguty8712 Posted May 25, 2020 Posted May 25, 2020 (edited) Hola Chicos soy nuevo en el tema, quisiera que me ayuden. I want to click the button depending on the number that appears in front I Have: Local $oTableCollection = _IETableGetCollection($oIE ) For $oAll In $oTableCollection $aTableData = _IETableWriteToArray($oAll, True) For $i = 1 to 100 if $aTableData[$i][2] = "1084552701" Then MsgBox(0,"",$aTableData[$i][2]) $Datos = _IETagNameGetCollection($oIE, "span") For $oSpan In $Datos If $oSpan.innerText = "description" Then _IEAction($oSpan, 'click') ExitLoop ElseIf $oSpan =0 Then MsgBox(0,"Error","l") _Parar() EndIf Next $lista = _ArrayDisplay($Datos) ;_IEAction($oSpan, 'click') ;_IEAction($Edit, 'Focus') EndIf Next Next Edited May 26, 2020 by Melba23 Added code tags
Nine Posted May 25, 2020 Posted May 25, 2020 Very hard to help you with the provided informations. First give full runable snippet of your script. We will probably need to access the web site that gives you problem. At the very minimum, post DOM of the part you have problem with. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
alguty8712 Posted May 26, 2020 Author Posted May 26, 2020 (edited) This is the best thing that I have achieved .. it works but I don't think it's the best way #include <Excel.au3> #include <array.au3> #include <IE.au3> #include <MsgBoxConstants.au3> Global $oIE = _IECreate("https://psi.icbf.gov.co/entregaraciones/seguimiento",1) Local $oTableCollection = _IETableGetCollection($oIE,0 ) Local $oSpans = _IETagNameGetCollection($oIE, "span") $aTableData = _IETableWriteToArray($oTableCollection,True) For $i = 1 to 100 if $aTableData[$i][2] = "1030002000" Then For $oSpan In $oSpans If $oSpan.innerText = "description" Then $item = $oSpans(42+$i) _IEAction($item, "click") ExitLoop ElseIf $oSpan =0 Then MsgBox(0,"Error","Hubo un problema al seleccionar la Regional") EndIf Next EndIf Next Edited May 26, 2020 by Melba23 Added code tags
alguty8712 Posted May 26, 2020 Author Posted May 26, 2020 (edited) Thank please help! Edited May 26, 2020 by Melba23 Removed translated quote
careca Posted May 26, 2020 Posted May 26, 2020 Seems to be good code. Why do you think it's not the best way? Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
Nine Posted May 26, 2020 Posted May 26, 2020 We cannot access the web site. Hard to tell if there is a better way to achieve what you are trying to do. As @careca said, at first glance, your code seems to be alright. Try to remove hard coded data (like for example, 100 in the for loop. Use ubound function instead). “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
alguty8712 Posted May 26, 2020 Author Posted May 26, 2020 (edited) thaks!!! Ubound is Better $Row = $oExcel_1.ActiveCell.Row; Recalcula fila Actual $Id_Beneficiario= _Excel_RangeRead($wkbook, Default, "B" & $Row,True) $Y = 0 For $i = 1 to UBound($aTableData)-1 if $aTableData[$i][2] = $Id_Beneficiario Then $Y=1 For $oSpan In $oSpans If $oSpan.innerText = "description" Then $item = $oSpans(42+$i) _IEAction($item, "click") ExitLoop ElseIf $oSpan =0 Then MsgBox(0,"Error","Hubo un problema al seleccionar la Regional") EndIf Next EndIf Next If $Y = 0 Then $msgBox = MsgBox(4,"Error","Beneficiario no encontrado por favor Verifique los números, Desea Reintentar?") If $msgBox = 6 Then Selecciona_Benef() _Seleccione() EndIf Else Cargar() EndIf Edited May 26, 2020 by Melba23 Removed quote and added code tags
Moderators Melba23 Posted May 26, 2020 Moderators Posted May 26, 2020 alguty8712, Welcome to the AutoIt forum. A couple of points if I may: - When you post code in future please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. - When you reply in future, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - responders know what they wrote (and translating it makes it even worse!) and it just pads the thread unnecessarily. Thanks in advance for your cooperation. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now