[Python] python之行post请求 →→→→→进入此内容的聊天室

来自 , 2021-01-28, 写在 Python, 查看 136 次.
URL http://www.code666.cn/view/e70981fd
  1. #!/usr/bin/python
  2. import urllib,urllib2
  3.  
  4. url = 'http://www.commentcamarche.net/search/search.php3'
  5. parameters = {'Mot' : 'Gimp'}
  6.  
  7. data = urllib.urlencode(parameters)    # Use urllib to encode the parameters
  8. request = urllib2.Request(url, data)
  9. response = urllib2.urlopen(request)    # This request is sent in HTTP POST
  10. page = response.read(200000)
  11. #//python/1878

回复 "python之行post请求"

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

captcha