Jump to content
  1. argumentum

    argumentum

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By goku200
      I'm having an issue with my html paginated table. The script work as expected. It reads the html table and clicks on the Download button. However when it clicks on the next page its not iterating the items. instead it goes to the next URL from the spreadsheet and then iterates through the html table clicking the Download button and so on. Not sure why its doing that. I want it to click the next page and then continue iterating then after it has reached the end of the pagination go to the next url in the spreadsheet and repeat the process. Below is my script. Any help is appreciated ūüôā
      HTML Table:
      <!doctype html> <html> <head> <meta charset="utf-8"> <title>Test</title> </head> <body> <span style="font-weight:bold; font-size:13px">12345</span> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody><tr> <td> <table width="100%" cellspacing="1" cellpadding="2" border="0"> <tbody> <tr> <td class="test">ID</td> <td class="test" width="100%" nowrap=""> Name</td> <td class="test" nowrap="">Test1 Name</td> <td class="test" nowrap="">Test Date</td> <td class="test" nowrap="">Test Default</td> <td class="test" nowrap="">Test Status</td> <td class="test" nowrap="">Test Format</td> <td class="test" colspan="4">Actions&nbsp;</td> </tr> <tr> <td class="test" align="center">1</td> <td class="test">Test1</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">1/19/2022</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download1">Download</a></td> </tr> <tr> <td class="test" align="center">2</td> <td class="test">Test2</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">1/19/2022</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download2">Download</a></td> </tr> <tr> <td class="test" align="center">3</td> <td class="test">Test3</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">1/19/2022</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download3">Download</a></td> </tr> <tr> <td class="test" align="center">4</td> <td class="test">Test4</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">1/19/2022 </td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download4">Download</a></td> </tr> <tr> <td class="test" align="center">5</td> <td class="test">Test5</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">1/19/2022</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download5">Download</a></td> </tr> <tr> <td class="test" align="center">6</td> <td class="test">Test6</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">1/19/2022</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download6">Download</a></td> </tr> <tr> <td class="test" align="center">7</td> <td class="test">Test7</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">1/19/2022</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download7">Download</a></td> </tr> <tr> <td class="test" align="center">8</td> <td class="test">Test8</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">1/19/2022</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download8">Download</a></td> </tr> <tr> <td class="test" align="center">9</td> <td class="test">Test9</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">1/7/2022</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download9">Download</a></td> </tr> <tr> <td class="test" align="center">10</td> <td class="test">Test10</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">12/8/2021</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download10">Download</a></td> </tr> <tr> <td class="test" align="center">11</td> <td class="test">Test11</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">12/5/2021</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download11">Download</a></td> </tr> <tr> <td class="test" align="center">12</td> <td class="test">Test12</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">12/5/2021</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download12">Download</a></td> </tr> <tr> <td class="test" align="center">13</td> <td class="test">Test13</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">12/5/2021</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download13">Download</a></td> </tr> <tr> <td class="test" align="center">14</td> <td class="test">Test14</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">11/29/2021</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download14">Download</a></td> </tr> <tr> <td class="test" align="center">15</td> <td class="test">Test15</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">11/29/2021</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download15">Download</a></td> </tr> <tr> <td class="test" align="center">16</td> <td class="test">Test16</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">11/29/2021</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download16">Download</a></td> </tr> <tr> <td class="test" align="center">17</td> <td class="test">Test17</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">11/29/2021</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download17">Download</a></td> </tr> <tr> <td class="test" align="center">18</td> <td class="test">Test18</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">11/29/2021</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download18">Download</a></td> </tr> <tr> <td class="test" align="center">19</td> <td class="test">Test19</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">11/29/2021</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download19">Download</a></td> </tr> <tr> <td class="test" align="center">20</td> <td class="test">Test20</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">11/29/2021</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download20">Download</a></td> </tr> <tr> <td class="test" align="center">21</td> <td class="test">Test21</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">11/29/2021</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download21">Download</a></td> </tr> <tr> <td class="test" align="center">22</td> <td class="test">Test22</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">11/29/2021</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download22">Download</a></td> </tr> <tr> <td class="test" align="center">23</td> <td class="test">Test23</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">11/29/2021</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download23">Download</a></td> </tr> <tr> <td class="test" align="center">24</td> <td class="test">Test24</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">11/29/2021</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download24">Download</a></td> </tr> <tr> <td class="test" align="center">25</td> <td class="test">Test25</td> <td class="test" nowrap="">Joe</td> <td class="test" nowrap="">11/29/2021</td> <td class="test" nowrap=""> Default </td> <td class="test" nowrap=""> Uploaded </td> <td class="test" nowrap=""> html </td> <td class="test"><a href="#Download25">Download</a></td> </tr> </tbody></table> </td></tr> </tbody></table> <table cellspacing="1" cellpadding="3" border="0"> <tbody><tr> <td valign="middle"> </td> <td valign="middle"> <select name="next"> <option value="1" selected="">Page 1 of 7 </option><option value="2">Page 2 of 7 </option><option value="3">Page 3 of 7 </option><option value="4">Page 4 of 7 </option><option value="5">Page 5 of 7 </option><option value="6">Page 6 of 7 </option><option value="7">Page 7 of 7 </option></select> </td> <td valign="middle"> <a href="Next">Next</a> </td> </tr> </tbody></table> </body> </html> Autoit script
      #Include "wd_core.au3" #Include "wd_helper.au3" #Include "WinHttp.au3" #include <MsgBoxConstants.au3> #include <File.au3> #include <AutoItConstants.au3> #include <WinAPIFiles.au3> #include <Array.au3> #include <Excel.au3> Local $sDesiredCapabilities, $sSession SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_LoadWait($sSession) Sleep(5000) _WD_LoadWait($sSession) Sleep(5000) _WD_Navigate($sSession, '') _WD_LoadWait($sSession) _WD_NewTab($sSession) $ArticleWindow = _WD_Window($sSession, 'window', '') _WD_LoadWait($sSession) sleep(5000) _ExcelFunction() Func _ExcelFunction() Local $oAppl = _Excel_Open() Local $sWorkbook = "C:\Users\<username here>\Downloads\table.xlsx" Local $oWorkbook = _Excel_BookOpen($oAppl, $sWorkbook) Local $aArray2 = _Excel_RangeRead($oWorkbook,Default,$oWorkbook.ActiveSheet.Usedrange.Columns("A:A")) For $i = 0 To UBound($aArray2) - 1 ;Skip from reading header columns Local $Skipline = 1 ;0==> first line Local $temprf $temprf &= $aArray2[$i] If @error Then ContinueLoop If $i < $Skipline Then ContinueLoop _WD_Window($sSession, 'Switch', '{"handle":"' & $ArticleWindow & '"}') sleep(500) _WD_Navigate($sSession, $aArray2[$i]) _WD_LoadWait($sSession) Sleep(2000) htmlTable() Next EndFunc Func htmlTable() $sTable = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//html/body/table[1]/tbody/tr/td/table") _WD_HighlightElement($sSession, $sTable, 2) _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, "//html/body/table[1]/tbody/tr/td/table/tbody") Local $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//html/body/table[1]/tbody/tr/td/table/tbody") Local $aArray1 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, ".//td[8]/a", $sElement, True) For $i = 0 to UBound($aArray1) - 1 $aArray1[$i] = _WD_ElementAction($sSession, $aArray1[$i], 'text') Next _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, "//html/body/table[1]/tbody/tr/td/table/tbody") Local $sElement1 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//html/body/table[1]/tbody/tr/td/table/tbody") Local $aArray11 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, ".//td[1]", $sElement1, True) For $j = 0 to UBound($aArray11) - 1 ;Skip from reading header columns Local $Skipline = 0 ;0==> first line Local $temprf $temprf &= $aArray11[$j] If @error Then ContinueLoop If $j < $Skipline Then ContinueLoop $aArray11[$j] = _WD_ElementAction($sSession, $aArray11[$j], 'text') Next ;Finds the ID and places it in a variable Local $sElement10 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//html/body/span") $sValue = _WD_ElementAction($sSession, $sElement10, 'text') ;Finds the ID and places it in a variable Local $sElement11 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, ".//td[1]") $sValue2 = _WD_ElementAction($sSession, $sElement11, 'text') For $i = 0 to UBound($aArray1) - 1 ;Find the table of all the IDs $sButton1 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//html/body/table[1]/tbody/tr/td/table") _WD_HighlightElement($sSession, $sButton1, 2) _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, "//html/body/table[1]/tbody/tr/td/table/tbody") Local $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//html/body/table[1]/tbody/tr/td/table/tbody") Local $aArray1 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, ".//td[8]/a", $sElement, True) _WD_HighlightElement($sSession, $aArray1, 2) $links = _WD_ElementAction($sSession, $aArray1[$i], 'click') Sleep(2000) FileMove('C:\Users\<username here>\Downloads\*.html', 'C:\Users\<username here>\Downloads\' & $sValue & "_r" & $aArray11[$i] & '.htm', 1) Next ;Click on Next Page Local $next = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//html/body/table[2]/tbody/tr/td[3]/a") _WD_ElementAction($sSession, $next, 'click') Sleep(2000) EndFunc _WD_Shutdown() Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"debuggerAddress": "localhost:9222"} {"w3c": true, "args":["start-maximized","disable-infobars"]}}}}' EndFunc  
    • By walec
      Hello
      How can I export a sheet to pdf using the OOoCalc.au3 UDF?
      Thank you for any hints or possibly other solutions / functions.
    • By mLipok
      ; #INDEX# =======================================================================================================================
      ; Title .........: UDF for "Debenu Quick PDF Library"
      ; AutoIt Version : 3.3.10.2++
      ; Language ......: English
      ; Description ...: A collection of functions for Debenu Quick PDF Library
      ; Author(s) .....: mLipok
      ; Modified ......:
      ; ===============================================================================================================================
      Release note:
       
       
      Erratum v0.7:
       
      Forum link:
       
       
    • By mLipok
      I would like to present, the UDF for Debenu Quick PDF Library
      Getting Started:
      http://www.debenu.com/products/development/debenu-pdf-library/getting-started/getting-started-activex-edition/
      Function Reference:
      http://www.debenu.com/docs/pdf_library_reference/FunctionGroups.php
      Useful information:
      http://www.quickpdf.org/forum/quickpdf-the-first-steps_topic1242.html
      http://www.quickpdflibrary.com/blog/2011/02/the-basics-getting-familiar-with-quick-pdf-library/
      First time installing Debenu Quick PDF Library:
      You can download demo here:
      http://www.quickpdflibrary.com/downloads/quick_pdf_library_demo.exe
      Requirements:
      file "DebenuPDFLibraryLite1012.dll" or "DebenuPDFLibraryAX1014.dll" must be in @ScriptDir

      if you want to try you must download it from here:
      http://www.debenu.com/products/development/debenu-pdf-library/trial/
      or
      http://www.debenu.com/products/development/debenu-pdf-library-lite/free/
      after install you can find this dll in:
      "c:\Program Files (x86)\DebenuPDF Library\ActiveX\DebenuPDFLibraryAX1014.dll"
      or
      "c:\Program Files (x86)\DebenuPDF Library\Lite\DebenuPDFLibraryLite1012.dll"

      !!! you can change DLL to newer version using _QPDF_NewLibraryPath_Commercial()

      EDIT: actualy (19-06-2015) there is DebenuPDFLibraryAX1115.dll and DebenuPDFLibraryLite1115.dll
        to use the commercial version you need to use the _QPdf_SetLicenseKey() AutoIt 3.3.10.2++ For UDF and examples download, and the current version information please go to download section:

       
      The following information are outdated
    • By mLipok
      This is a UDF for use Debenu PDF Viewer SDK - ActiveX component.
      You can read more about this ActiveX component here:
      http://www.debenu.com/products/development/debenu-pdf-viewer-sdk/
       
      v 0.2
       
      2015/05/18   v0.3
       
×
×
  • Create New...