Jump to content

HTTP GET/Parsing


Recommended Posts

I'm so far over my head I'm drowning. Any assistance is greatly appreciated.

I have used AutoIT to automate opening a URL, entering the login ID & Password, then proceeding. I have this script running on a virtual machine from my server. When I have the VM image open on my local PC and watch it the script runs fine. But when it run autonomously the first window fails to be come active and it hangs.

Digging through the forums I find comments about being able to parse information from a page call. But I have not found examples that I understand.

When I use this string (actual domain name removed here):

$oIE = _IECreate ("domain.com/api/xml?action=common-info&domain=domain.com")

I get this result on the IE screen:

<?xml version="1.0" encoding="utf-8" ?>

- <results>

<status code="ok" />

- <common locale="en" time-zone-id="85">

<cookie>XB88ewrxwer999ser</cookie>

<date>2008-06-29T04:12:33.620+00:00</date>

<host>http://$oie = _iecreate ("domain.com</host>

<local-host>aereomaren</local-host>

<admin-host>admin.domain.com</admin-host>

<url>/api/xml?action=common-info&domain=domain.com")</url>

<version>application_700_r713</version>

<user-agent>Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727; MS-RTC LM 8)</user-agent>

</common>

</results>

From this return text I need the cookie value <cookie>XB88ewrxwer999ser</cookie> in a string that I can use elsewhere.

How do I parse the cookie value into a string so I can use it as a variable?

I'm am assuming it would be similar to parse the value <status code="ok" /> from another URL call.

My plan is:

Open the URL in question

Get & Parse the cookie data into a variable

Use the cookie data in another URL string

Open the new URL

Check for the "status code" as "OK", if yes procees; if no error dialog

Capture the data returned from the URL string is proving elusive.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...