tobject Posted April 25, 2010 Posted April 25, 2010 I was playing with Google spreadsheets _ImportXML function but they allow only 50 per sheet is there a similar function for AutoIt? I checked Help - not much there =importXML("URL";"query") URL - the URL of the XML or HTML file query - the XPath query to run on the data given at the URL. For example, "//a/@href" returns a list of the href attributes of all <a> tags in the document (i.e. all of the URLs the document links to). Each result from the XPath query is placed in its own row of the spreadsheet. For more information about XPath, please visit http://www.w3schools.com/xpath/ Example: =importXml("www.google.com"; "//a/@href"). This returns all of the href attributes (the link URLs) in all the <a> tags on www.google.com homepage
PsaltyDS Posted April 26, 2010 Posted April 26, 2010 (edited) AutoIt is not a spreadsheet. It can be used with the automation interfaces provided by some spreadsheets. For example, the COM interface to MS Excel. So if the version of Excel you had installed supported that equation format, then AutoIt could use Excel to perform it.Native to AutoIt, you could pull down the XML with InetGet, and use the _XMLDOMWrapper UDF to perform XPath queries on it (the UDF uses MSXML). Edited April 26, 2010 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
tobject Posted May 2, 2010 Author Posted May 2, 2010 Ok I tested XPath in Google - it retrieves data just fine Now in AutoIt I get 0 nodes back Any idea why? $xmlDoc=ObjCreate("Microsoft.XMLDOM"); if IsObj($xmlDoc) Then MsgBox(0,"sdsdsd","Success"); endif; $xmlDoc.async=false; $xmlDoc.load("Profile616.htm"); $xmlDoc.setProperty("SelectionLanguage", "XPath"); $XPath="//td//td[(((count(preceding-sibling::*) + 1) = 1) and parent::*)]//tr[(((count(preceding-sibling::*) + 1) = 1) and parent::*)]//tr//td"; $xmlNodeList = $xmlDoc.selectNodes($XPath); MsgBox(0,"sdsdsd",$xmlNodeList.Length); For $xmlNode in $xmlNodeList MsgBox(0,"sdsdsd",$xmlNode.Text); Next
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