Sign in to follow this  
Followers 0
Dieuz

XML to string

8 posts in this topic

#1 ·  Posted (edited)

Hey guys,

I am using The Yahoo Site Explorer api and when I send an html request, it returns a XML page.

How can I convert this XML source page to a string without downloading the .xml file?

Request example: http://search.yahooapis.com/SiteExplorerService/V1/inlinkData?appid=YahooDemo&query=http://search.yahoo.com&results=2

Thanks!

;)

Edited by Dieuz

Share this post


Link to post
Share on other sites



XML is a plain text format. Did you save the returned data to a file?

$sString = FileRead("C:\Temp\YourFile.xml")

;)


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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

XML is a plain text format. Did you save the returned data to a file?

$sString = FileRead("C:\Temp\YourFile.xml")

;)

Well I would like NOT to save the XML file because I have alot of check to do and I dont want to save/delete 1000+ files on my computer. How could I just retrieve the xml source page direct from the browser.

Edited by Dieuz

Share this post


Link to post
Share on other sites

I don't know anything about the "Yahoo Site Explorer api". When you say that "it returns a XML page", where is it returned to?

;)


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

Share this post


Link to post
Share on other sites

I don't know anything about the "Yahoo Site Explorer api". When you say that "it returns a XML page", where is it returned to?

;)

Heres an example of a request and what it return:

http://search.yahooapis.com/SiteExplorer...&query=http://search.yahoo.com&results=2

Share this post


Link to post
Share on other sites

This works:
#include <INet.au3>

$sXML = _INetGetSource("http://search.yahooapis.com/SiteExplorer")
ConsoleWrite("$sXML = " & $sXML & @LF)

;)


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

Share this post


Link to post
Share on other sites

..or

Local $oXML = ObjCreate('Microsoft.XMLHTTP')

$oXML.Open("POST", "http://search.yahooapis.com/SiteExplorerService/V1/inlinkData?appid=YahooDemo&query=http://search.yahoo.com&results=2", 0)
$oXML.Send

ConsoleWrite($oXML.responseText & @CRLF)

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

This works:

#include <INet.au3>

$sXML = _INetGetSource("http://search.yahooapis.com/SiteExplorer")
ConsoleWrite("$sXML = " & $sXML & @LF)

;)

Yay it works! Thanks Psalty!

:evil:

Edited by Dieuz

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0