"Bob Bridges" <rhbridg.RemoveThisNode@xxxxxx> wrote in message
news:42A49137-AF00-4F2B-A699-2777B8B2DEE3@xxxxxx
Quote:
>A few comments:
>
> 1) I didn't realize you could just add the values of fields to a URL; I
> thought I had to get my program to fill in the values of the text boxes,
> drop-down lists etc, and then simulate a click on the correct button. I
> should spend more time in this forum.
Be aware of a few things when using this method. In the URL used in this
example, the Post URL was a fully qualified URL. In more cases than not,
this is not the case. It will be a relative path. For instance, the Google
groups advanced search URL is 'http://groups.google.com/advanced_search'.
The Post URL listed in the page is '/groups', so you would use the parent
URL plus the Post URL: 'http://groups.google.com/groups'. If you want a
search of the word 'vbscript', you could use
'http://groups.google.com/groups?as_q=vbscript'.
The second thing to be aware of is URL encoding. If you want to do the
same search as above, but search for multiple words, like 'vbscript xml',
you need encode the space. You could use something like
'http://groups.google.com/groups?as_q=vbscript%20xml'. If you are not
already aware of URL encoding, see this page:
http://www.permadi.com/tutorial/urlEncoding/
I use a function to just encode the reserved characters rather than the
entire URL. Below is the function I use. It is not extensively tested &
might be missing some characters, so use it with caution.
Function EncodeURL(ByVal sURL)
Dim i, sChar, sToEncode
sToEncode = "$&+,/:;=?@ <>#%{}|\^~[]`"
For i = 1 to Len(sURL)
sChar = Mid(sURL, i, 1)
If InStr(sToEncode, sChar) > 0 Then sChar = "%" & Right("00" &
Hex(Asc(sChar)), 2)
EncodeURL = EncodeURL & sChar
Next
End Function