[Python] python提交post数据到远程url →→→→→进入此内容的聊天室

来自 , 2019-12-14, 写在 Python, 查看 143 次.
URL http://www.code666.cn/view/4b17d326
  1. import sys, urllib2, urllib
  2.  
  3. zipcode = "S2S 1R8"
  4. url = 'http://www.wunderground.com/cgi-bin/findweather/getForecast'
  5. data = urllib.urlencode([('query', zipcode)])
  6. req = urllib2.Request(url)
  7. fd = urllib2.urlopen(req, data)
  8. while 1:
  9.     data = fd.read(1024)
  10.     if not len(data):
  11.         break
  12.     sys.stdout.write(data)
  13.  
  14. #//python/8061

回复 "python提交post数据到远程url"

这儿你可以回复上面这条便签

captcha