Trong Posted April 5, 2023 Share Posted April 5, 2023 I want to get the file list and other information such as type (folder, file) size, date changed, ..) array displayed in html table. I am using _StringBetwent(), i takes many hours but the code is still not giving the desired result. Please help with another method or some fast way without having to edit the code for each different page about apche style index. HTML Eg 5 col: <tr><th valign="top"><img src="/icons/blank.gif" alt="[ICO]"></th><th><a href="?C=N;O=D">Name</a></th><th><a href="?C=M;O=A">Last modified</a></th><th><a href="?C=S;O=A">Size</a></th><th><a href="?C=D;O=A">Description</a></th></tr> <tr><th colspan="5"><hr></th></tr> <tr><td valign="top"><img src="/icons/back.gif" alt="[PARENTDIR]"></td><td><a href="/autoit3/scite/download/">Parent Directory</a></td><td> </td><td align="right"> - </td><td> </td></tr> <tr><td valign="top"><img src="/icons/text.gif" alt="[TXT]"></td><td><a href="AbbrevMan.au3">AbbrevMan.au3</a></td><td align="right">2022-07-03 13:39 </td><td align="right"> 30K</td><td> </td></tr> <tr><td valign="top"><img src="/icons/binary.gif" alt="[ ]"></td><td><a href="Au3Check.exe">Au3Check.exe</a></td><td align="right">2022-10-20 07:49 </td><td align="right">219K</td><td> </td></tr> <tr><td valign="top"><img src="/icons/binary.gif" alt="[ ]"></td><td><a href="Au3Stripper.exe">Au3Stripper.exe</a></td><td align="right">2023-01-29 13:56 </td><td align="right">167K</td><td> </td></tr> <tr><td valign="top"><img src="/icons/text.gif" alt="[TXT]"></td><td><a href="AutoIt3Wrapper.au3">AutoIt3Wrapper.au3</a></td><td align="right">2023-03-15 15:19 </td><td align="right">326K</td><td> </td></tr> <tr><td valign="top"><img src="/icons/text.gif" alt="[TXT]"></td><td><a href="AutoItAutoComplete.lua">AutoItAutoComplete.lua</a></td><td align="right">2022-06-19 19:04 </td><td align="right">6.7K</td><td> </td></tr> <tr><td valign="top"><img src="/icons/text.gif" alt="[TXT]"></td><td><a href="AutoItGotoDefinition.lua">AutoItGotoDefinition.lua</a></td><td align="right">2022-06-20 12:13 </td><td align="right"> 16K</td><td> </td></tr> <tr><td valign="top"><img src="/icons/text.gif" alt="[TXT]"></td><td><a href="AutoItTools.lua">AutoItTools.lua</a></td><td align="right">2022-06-20 11:25 </td><td align="right"> 74K</td><td> </td></tr> <tr><td valign="top"><img src="/icons/text.gif" alt="[TXT]"></td><td><a href="History.html">History.html</a></td><td align="right">2022-04-23 17:34 </td><td align="right">127K</td><td> </td></tr> <tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="Scheme/">Scheme/</a></td><td align="right">2020-05-04 15:47 </td><td align="right"> - </td><td> </td></tr> <tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="SciLexer.dll">SciLexer.dll</a></td><td align="right">2022-04-22 13:21 </td><td align="right">1.2M</td><td> </td></tr> <tr><td valign="top"><img src="/icons/binary.gif" alt="[ ]"></td><td><a href="SciTE.exe">SciTE.exe</a></td><td align="right">2022-03-17 18:26 </td><td align="right">1.0M</td><td> </td></tr> <tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="SciTE4AutoIt3.chm">SciTE4AutoIt3.chm</a></td><td align="right">2022-03-17 09:43 </td><td align="right">1.1M</td><td> </td></tr> <tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="SciTE5-with-DynamicFunctions/">SciTE5-with-DynamicFunctions/</a></td><td align="right">2023-04-04 19:43 </td><td align="right"> - </td><td> </td></tr> <tr><td valign="top"><img src="/icons/text.gif" alt="[TXT]"></td><td><a href="SciTE%20Jump.au3">SciTE Jump.au3</a></td><td align="right">2022-03-14 08:51 </td><td align="right">146K</td><td> </td></tr> <tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="SciTELite/">SciTELite/</a></td><td align="right">2016-03-11 13:16 </td><td align="right"> - </td><td> </td></tr> <tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="SciteConfig.au3">SciteConfig.au3</a></td><td align="right">2022-07-03 14:03 </td><td align="right"> 69K</td><td> </td></tr> <tr><td valign="top"><img src="/icons/text.gif" alt="[TXT]"></td><td><a href="SmartAutoCompleteHide.lua">SmartAutoCompleteHide.lua</a></td><td align="right">2022-06-18 18:53 </td><td align="right">3.7K</td><td> </td></tr> <tr><td valign="top"><img src="/icons/binary.gif" alt="[ ]"></td><td><a href="Tidy.exe">Tidy.exe</a></td><td align="right">2022-11-04 21:17 </td><td align="right">184K</td><td> </td></tr> <tr><td valign="top"><img src="/icons/text.gif" alt="[TXT]"></td><td><a href="UCTMan.au3">UCTMan.au3</a></td><td align="right">2022-07-03 13:39 </td><td align="right"> 28K</td><td> </td></tr> <tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="au3.api">au3.api</a></td><td align="right">2022-03-06 00:52 </td><td align="right">530K</td><td> </td></tr> <tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="au3.autoit3wrapper.api">au3.autoit3wrapper.api</a></td><td align="right">2022-06-15 17:19 </td><td align="right">2.3K</td><td> </td></tr> <tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="autoit3wrapper.keywords.properties">autoit3wrapper.keywords.properties</a></td><td align="right">2022-06-15 17:19 </td><td align="right">2.5K</td><td> </td></tr> i Regards, Link to comment Share on other sites More sharing options...
SOLVE-SMART Posted April 5, 2023 Share Posted April 5, 2023 Hi @Trong, I am not sure what you want to be honest. I don't understand it. Could you please describe what you mean by: 56 minutes ago, Trong said: without having to edit the code for each different page about apche style index. ? Apart from this, you want a one time execution for exact this table structure or should it be a dynamical way of parsing the required information? In case you only need a one time shot, you could simple paste this content into the Browser DevTools and get your requested information by XPath. No need to script/program anything. But yes, only in case of this table (one time). Please give me/us more information, thanks 🤝 . Best regards Sven Stay innovative! Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon) Link to comment Share on other sites More sharing options...
Solution Gianni Posted April 5, 2023 Solution Share Posted April 5, 2023 assuming the html source is in a file called for example HTML_Table.html, you can use these 4 lines of code to extract the data from the table and have it returned in an array: #include <_HtmlTable2Array.au3> ; <-- Get this here: https://www.autoitscript.com/forum/topic/167679-read-data-from-html-tables-from-raw-html-source/ Local $Source = FileRead("html_Table.html") Local $aTableData = _HtmlTableWriteToArray($Source) _ArrayDisplay($aTableData) Trong and SOLVE-SMART 1 1 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Trong Posted April 6, 2023 Author Share Posted April 6, 2023 It work, thank @Gianni @SOLVE-SMART thanks for care. Directory listings have style variations. Regards, Link to comment Share on other sites More sharing options...
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