开发者

Retrieve some info from the web automatically

开发者 https://www.devze.com 2022-12-27 13:42 出处:网络
I need to retrieve some info from web. For example, I can visit weather.com to search my zip code to get H开发者_如何学GoTML file that contains the temperature or something. I need to make a python sc

I need to retrieve some info from web. For example, I can visit weather.com to search my zip code to get H开发者_如何学GoTML 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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消