views:

21

answers:

1

I need to retrieve some info from web. For example, I can visit weather.com to search my zip code to get HTML file that contains the temperature or something. I need to make a python script to do this automatically.

I think there are two ways to do this.

  1. Run wget to download the web page, parse it to get the information I want.
  2. If the website provides the web service, just run it to get the info.

And these are my questions.

  1. What function do I use for the web service in python?
  2. How can I know if a web site provides what web service?
  3. If web service is not provided, is there a better way than run wget and parse?

If you can give me some examples, that would be much better.

+2  A: 

The wget part is definitely unnecessary, urllib and httplib both let you download a web page; their doc pages have examples

Michael Mrozek