| View previous topic :: View next topic |
| Author |
Message |
bigsalgo911
Joined: 02 Jul 2008 Posts: 29
|
Posted: Thu Jul 03, 2008 8:50 pm Post subject: Using xpath to load XML data via HTTPS |
|
|
What I'm trying to do is load certain variables from a web based account access system in to an AHK script putting the variables where they need to go. I am using the following code to attempt to load the xml information:
| Code: |
xpath_load(xmlin, "https://xxx.yyy.com/main?cmd=display&user_cust_id=%ID%&raw=1") |
the %ID% is user defined earlier in the script.
Then I have created a hotkey as follows:
| Code: | F6::
{
cust_email := xpath(xml, "/root/cust_email/text()")
GuiControl,, Email2, %cust_email%
}return |
However it never appears to load the xml data. Is there extra code I need to have since I'm trying to load the info via HTTPS or is that not the issue at all?
The XML document appears kinda like this:
| Code: | <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <root>
<cust_blacklist>0</cust_blacklist>
<cust_country>US</cust_country>
<cust_email>email goes here</cust_email>
<cust_first_date>03/06/2007 06:36:01 AM</cust_first_date>
<cust_last_date>07/02/2008</cust_last_date>
<cust_nickname>nickname</cust_nickname> |
What am I doing wrong? |
|
| Back to top |
|
 |
Oberon
Joined: 18 Feb 2008 Posts: 442
|
Posted: Thu Jul 03, 2008 9:09 pm Post subject: |
|
|
Update to the latest version of xpath and try this:
| Code: | tmp = %A_Temp%\x
URLDownloadToFile, https://xxx.yyy.com/main?cmd=display&user_cust_id=%ID%&raw=1, %tmp%
FileRead, xml, %tmp%
FileDelete, %tmp%
xpath_load(xml)
Return
F6::
cust_email := xpath(xml, "/root/cust_email/text()")
GuiControl, , Email2, %cust_email%
Return |
|
|
| Back to top |
|
 |
bigsalgo911
Joined: 02 Jul 2008 Posts: 29
|
Posted: Thu Jul 03, 2008 9:21 pm Post subject: |
|
|
OMG that was perfect. Genuis I tell you!
Anyway I can put a progress bar n my UI for that download? |
|
| Back to top |
|
 |
bigsalgo911
Joined: 02 Jul 2008 Posts: 29
|
Posted: Thu Jul 03, 2008 10:44 pm Post subject: |
|
|
| lol nm I got it. Thank you SO much for that code. You may have gotten me a raise at work! |
|
| Back to top |
|
 |
|