I am trying to automate data download from a site that requires a
usename and password. I first started with XMLHTTP but I am stuck
without support from the site on how to parse the POST request.

I have also tried using an IE object, but how do I get it to input the
username and password into the windows popup dialog?

Re: Automate IE popup dialog password input by Tim

Tim
Thu Dec 14 15:10:27 CST 2006

What does your XMLHTTP code look like? You should be able to pass the username/password through that object.

--
Tim Williams
Palo Alto, CA


"Brendan" <brendandetracey@yahoo.com> wrote in message news:1166121646.437923.112470@n67g2000cwd.googlegroups.com...
> I am trying to automate data download from a site that requires a
> usename and password. I first started with XMLHTTP but I am stuck
> without support from the site on how to parse the POST request.
>
> I have also tried using an IE object, but how do I get it to input the
> username and password into the windows popup dialog?
>



Re: Automate IE popup dialog password input by Brendan

Brendan
Fri Dec 15 07:18:50 CST 2006

I can pass username/password no problem but I do not know the correct
syntax to get the site to accept my request. Furthermore, when done
manually, the submission causes a new browser window to open from which
further selections must be made and then switches back to the original
window. A username/password is not actually required. The site is :
http://www.class.ncdc.noaa.gov/nsaa/products/search

A non-password version of my XMLHTTP code is below:
The commented msg line is the contents of an XML file that when
uploaded configures the search.

Dim xml, msg, fso, file
msg
="sub_id=0&data_start=1989-04-08&end_date=2006-12-13&start_date=2006-12-13&between_through=T&search_opt=SC&elon=-40.0&Receiving%20Station=WI&max_days_val=160&max_lat_val=80&Tool=XY&slat=40.0&end_time=23:59:59&Datatype=AVHRR_GAC&datatype_family=AVHRR&limit_search=true&start_time=00:00:00&data_end=2006-12-13&dsname_pattern=%5ENSS%5C.(GHRR%7CHRPT%7CLHRR%7CFRAC)%5C.(N%7CM)%5Cw%5C.D(%5Cd%7B5%7D)(.%7B0%2C24%7D)%24&nlat=70.0&Satellite=N18&wlon=-70.0&Node=B&max_lon_val=80&minDiff=0.1"
'msg = "<sc xmlns:xsp='http://apache.org/xsp'
xmlns:log='http://apache.org/xsp/log/2.0'
xmlns:xsp-request='http://apache.org/xsp/request/2.0'
xmlns:xsp-response='http://apache.org/xsp/response/2.0'
datatype_family='AVHRR'><item group='data_start'>1989-04-08</item><item
group='end_date'>2006-12-13</item><item
group='start_date'>2006-12-01</item><item
group='between_through'>T</item><item group='search_opt'>SC</item><item
group='elon'>-40.0</item><item group='Receiving Station'>WI</item><item
group='max_days_val'>160</item><item group='max_lat_val'>80</item><item
group='Tool'>XY</item><item group='slat'>40.0</item><item
group='end_time'>23:59:59</item><item
group='Datatype'>AVHRR_GAC</item><item
group='datatype_family'>AVHRR</item><item
group='limit_search'>true</item><item
group='start_time'>00:00:00</item><item
group='data_end'>2006-12-13</item><item
group='dsname_pattern'>^NSS\.(GHRR|HRPT|LHRR|FRAC)\.(N|M)\w\.D(\d{5})(.{0,24})$</item><item
group='nlat'>70.0</item><item group='Satellite'>N18</item><item
group='wlon'>-70.0</item><item group='Node'>B</item><item
group='max_lon_val'>80</item><item group='minDiff'>0.1</item></sc>"
Set xml = CreateObject("Microsoft.XMLHTTP")
'Set xml = CreateObject("MSXML2.XMLHTTP")
xml.Open "POST", "http://www.class.noaa.gov/nsaa/products/search",
FALSE
'xml.SetRequestHeader "Content-Type",
"application/x-www-form-urlencoded"
xml.Send msg
'WScript.Echo xml.getAllResponseHeaders
WScript.Echo "done"
set fso = WScript.CreateObject("Scripting.FileSystemObject")
set file = fso.CreateTextFile("c:\temp\test.html", TRUE)
file.WriteLine xml.ResponseText
file.Close
Set fso = Nothing
Set xml = Nothing




Tim Williams wrote:
> What does your XMLHTTP code look like? You should be able to pass the username/password through that object.
>
> --
> Tim Williams
> Palo Alto, CA
>
>
> "Brendan" <brendandetracey@yahoo.com> wrote in message news:1166121646.437923.112470@n67g2000cwd.googlegroups.com...
> > I am trying to automate data download from a site that requires a
> > usename and password. I first started with XMLHTTP but I am stuck
> > without support from the site on how to parse the POST request.
> >
> > I have also tried using an IE object, but how do I get it to input the
> > username and password into the windows popup dialog?
> >


Re: Automate IE popup dialog password input by Brendan

Brendan
Fri Dec 15 10:49:35 CST 2006

A trace returned this:
POST /nsaa/searchAVHRR HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, application/vnd.ms-excel,
application/vnd.ms-powerpoint, application/msword, */*
Referer: http://www.class.ncdc.noaa.gov/nsaa/products/search
Accept-Language: en-ca
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR
1.1.4322)
Host: www.class.ncdc.noaa.gov
Content-Length: 491
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: JSESSIONID=18B2CB5A6BDA08114021CBB20404DFCC

max_lat_val=80&max_lon_val=80&search_opt=SC&dsname_pattern=%5ENSS%5C.%28GHRR%7CHRPT%7CLHRR%7CFRAC%29%5C.%28N%7CM%29%5Cw%5C.D%28%5Cd%7B5%7D%29%28.%7B0%2C24%7D%29%24&Datatype=AVHRR_GAC&Node=B&Receiving+Station=WI&Satellite=N18&data_start=1989-04-08&data_end=2006-12-15&max_days_val=160&start_date=2006-12-13&end_date=2006-12-13&start_time=00%3A00%3A00&end_time=23%3A59%3A59&between_through=T&nlat=70.0&slat=40.0&elon=-40.0&wlon=-70.0&minDiff=0.1&Tool=XY&datatype_family=AVHRR&limit_search=true

Brendan wrote:
> I can pass username/password no problem but I do not know the correct
> syntax to get the site to accept my request. Furthermore, when done
> manually, the submission causes a new browser window to open from which
> further selections must be made and then switches back to the original
> window. A username/password is not actually required. The site is :
> http://www.class.ncdc.noaa.gov/nsaa/products/search
>
> A non-password version of my XMLHTTP code is below:
> The commented msg line is the contents of an XML file that when
> uploaded configures the search.
>
> Dim xml, msg, fso, file
> msg
> ="sub_id=0&data_start=1989-04-08&end_date=2006-12-13&start_date=2006-12-13&between_through=T&search_opt=SC&elon=-40.0&Receiving%20Station=WI&max_days_val=160&max_lat_val=80&Tool=XY&slat=40.0&end_time=23:59:59&Datatype=AVHRR_GAC&datatype_family=AVHRR&limit_search=true&start_time=00:00:00&data_end=2006-12-13&dsname_pattern=%5ENSS%5C.(GHRR%7CHRPT%7CLHRR%7CFRAC)%5C.(N%7CM)%5Cw%5C.D(%5Cd%7B5%7D)(.%7B0%2C24%7D)%24&nlat=70.0&Satellite=N18&wlon=-70.0&Node=B&max_lon_val=80&minDiff=0.1"
> 'msg = "<sc xmlns:xsp='http://apache.org/xsp'
> xmlns:log='http://apache.org/xsp/log/2.0'
> xmlns:xsp-request='http://apache.org/xsp/request/2.0'
> xmlns:xsp-response='http://apache.org/xsp/response/2.0'
> datatype_family='AVHRR'><item group='data_start'>1989-04-08</item><item
> group='end_date'>2006-12-13</item><item
> group='start_date'>2006-12-01</item><item
> group='between_through'>T</item><item group='search_opt'>SC</item><item
> group='elon'>-40.0</item><item group='Receiving Station'>WI</item><item
> group='max_days_val'>160</item><item group='max_lat_val'>80</item><item
> group='Tool'>XY</item><item group='slat'>40.0</item><item
> group='end_time'>23:59:59</item><item
> group='Datatype'>AVHRR_GAC</item><item
> group='datatype_family'>AVHRR</item><item
> group='limit_search'>true</item><item
> group='start_time'>00:00:00</item><item
> group='data_end'>2006-12-13</item><item
> group='dsname_pattern'>^NSS\.(GHRR|HRPT|LHRR|FRAC)\.(N|M)\w\.D(\d{5})(.{0,24})$</item><item
> group='nlat'>70.0</item><item group='Satellite'>N18</item><item
> group='wlon'>-70.0</item><item group='Node'>B</item><item
> group='max_lon_val'>80</item><item group='minDiff'>0.1</item></sc>"
> Set xml = CreateObject("Microsoft.XMLHTTP")
> 'Set xml = CreateObject("MSXML2.XMLHTTP")
> xml.Open "POST", "http://www.class.noaa.gov/nsaa/products/search",
> FALSE
> 'xml.SetRequestHeader "Content-Type",
> "application/x-www-form-urlencoded"
> xml.Send msg
> 'WScript.Echo xml.getAllResponseHeaders
> WScript.Echo "done"
> set fso = WScript.CreateObject("Scripting.FileSystemObject")
> set file = fso.CreateTextFile("c:\temp\test.html", TRUE)
> file.WriteLine xml.ResponseText
> file.Close
> Set fso = Nothing
> Set xml = Nothing
>
>
>
>
> Tim Williams wrote:
> > What does your XMLHTTP code look like? You should be able to pass the username/password through that object.
> >
> > --
> > Tim Williams
> > Palo Alto, CA
> >
> >
> > "Brendan" <brendandetracey@yahoo.com> wrote in message news:1166121646.437923.112470@n67g2000cwd.googlegroups.com...
> > > I am trying to automate data download from a site that requires a
> > > usename and password. I first started with XMLHTTP but I am stuck
> > > without support from the site on how to parse the POST request.
> > >
> > > I have also tried using an IE object, but how do I get it to input the
> > > username and password into the windows popup dialog?
> > >