screen-scraper logo The web data extraction experts Search
Navigation See our products Contact us Buy screen-scraper professional Help and support Download screen-scraper Free quote Navigation

Examples for URLFetch

You can never have enough examples! If you've done some tricky things with URLFetch and don't mind sharing your expertise, please send us your code! We'll post it here for everyone to enjoy.

links to examples on this page:
the basic (GET) fetch
the basic (GET) fetch with a twist
the basic fetch through a proxy server
the tricky (POST) fetch
a fetch with a munchie
a fetch with a few munchies
grab an image and spit it out
grab an image and save it for later
example HTTP headers


the basic (GET) fetch

this is an example of the simplest way to fetch a document
 
 

the basic (GET) fetch with a twist

here's a simple fetch with some data added to the GET request (notice the URL)
 
 

the basic fetch through a proxy server

this is a fetch that takes place by passing through a proxy server
NOTE: If you're having trouble getting URLFetch to work with a proxy server try assigning your proxy settings to the network connection on the server (e.g. using Internet Explorer under Tools->Internet Options, Connections tab). URLFetch will use these settings by default.

the tricky (POST) fetch

try this example that illustrates a basic POST request

a fetch with a munchie

this one shows you how to retrieve a cookie and send it back again

a fetch with a few munchies

this example is just like the last one, except that it retrieves and sets multiple cookies
you can actually try this one out by signing up for an account at headhunter.net and substituting your own e-mail address and password in the code!

grab an image and spit it out

this one grabs an image from a remote server and spits it out to the client

This one requires two files.

The first is grab_image.asp:

Here's the second file, we'll call it display_image.htm, that makes use of grab_image.asp.

grab an image and save it for later

this one grabs an image from a remote server and saves it as a file

example HTTP headers

this isn't a complete example, but rather some common HTTP headers to get and set

headers to set (that is, headers you'll want to set before making a request to a server)

here's a good list of User-Agent strings that I found: http://www.highermind.org/design/user_agent/?Action=List_UA

headers to get (that is, headers you'll after you've made a request to a server)

 
© 2002-2008 copyright e-kiwi, LLC
about us | blog | contact us | legal