jimihendrix857 Posted August 13, 2014 Share Posted August 13, 2014 Im new to AutoIt and somewhat new to scripting. Im trying to gather information from a website (https://www.cedarfinance.com/trade/) but its running a javascript so the standard WindowInfo tool doesnt help. Im trying to extract the current stock cost and place it into an excel file every hour to get historical data. Since my knowledge of java is limited Im reaching out to anyone that may be able to provide me with guidance. Thanks in advance. Link to comment Share on other sites More sharing options...
Gianni Posted August 13, 2014 Share Posted August 13, 2014 hi jimihendrix857 to extract data from a web page you could use the functions provided by the ie.au3 udf for example: _IETableGetCollection and _IETableWriteToArray could be used on your link in this way: #include <IE.au3> #include <Array.au3> ; open the page Local $oIE = _IECreate("https://www.cedarfinance.com/trade/") Local $oTable = _IETableGetCollection($oIE, 2) ; second table contains values Local $aTableData = _IETableWriteToArray($oTable, 1) ; put the list from web table to array _ArrayDisplay($aTableData) 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...
jimihendrix857 Posted August 14, 2014 Author Share Posted August 14, 2014 Do the IE commands work with Chrome? The page doesnt load right in IE resulting in not much information being placed in the array. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 15, 2014 Moderators Share Posted August 15, 2014 No (intuitively) the IE UDF is for..IE. I believe there is a Chrome UDF, though I have never used it. Your best bet is to look at the IUAutomation UDF at the top of the Examples forum. I know you can work in Chrome with that. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
MikahS Posted August 15, 2014 Share Posted August 15, 2014 Links: >IUAutomation UDF >Chrome UDF Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
Xenobiologist Posted August 15, 2014 Share Posted August 15, 2014 Do you have the site always open in your browser? Then a easy way would be (using Autoit) Activate the browser send CTRL +A then CTRL+C then use a Regex to get the info you want. Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
jimihendrix857 Posted August 27, 2014 Author Share Posted August 27, 2014 Thanks for everyones comments. The table extraction is perfect for that site. I have a 2nd site that doesn't have a clean table to extract but still in javascript. Spotfn.com is the site. The Regex solution is workable but not sure how to isolate a single number between two words and copy that into a variable. For example ......aslfkjdslfkajsdflaj CALL 1.111234 PUT lsdkfjsaldkfjasf...... How do I then place that into a variable? It definitively gets what I want but I feel like there is a simpler way. I.e. pull the exact element from the site but even with the IU automation UDF I cant seem to isolate that particular element. Once I can learn to hunt down and know how to call a value from a specific element I can propagate the knowledge into the rest of my program. I would also like to click buttons in the javascript and unless I know the element name, the only way this can be done is through x, y mouse clicks which can get messed up. Thanks 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