Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.078 X-Spam-Evidence: '*H*': 0.84; '*S*': 0.00; 'https': 0.07; 'urllib2': 0.07; 'subject:login': 0.16; 'wrote:': 0.16; 'received:74.125.82.174': 0.19; 'received:mail- wy0-f174.google.com': 0.19; 'header:In-Reply-To:1': 0.22; 'received:192.168.1.100': 0.23; "i'm": 0.27; 'right.': 0.28; 'import': 0.28; "skip:' 10": 0.30; 'error': 0.32; 'values': 0.32; 'probably': 0.33; "can't": 0.33; 'to:addr:python-list': 0.33; 'header:User-Agent:1': 0.34; 'message-id:@gmail.com': 0.34; 'response': 0.37; 'using': 0.37; 'but': 0.37; 'received:74.125.82': 0.38; 'received:google.com': 0.38; 'subject:: ': 0.39; 'received:192': 0.39; 'subject:with': 0.39; 'appreciated.': 0.39; 'data': 0.39; 'to:addr:python.org': 0.39; 'received:74.125': 0.39; 'exact': 0.68; 'login': 0.69; 'subject: ': 0.73; 'url:hi': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=qF7zxwsxXR8Qe7jJXWUbps8DbqRsO3X9F91S9IZIJ1I=; b=xMqB0Ql0RbJHPis8njk2ZgUtvm4vi3ZSUNXkenQDA+x6H9TllwIxFD2c81BU4JSnJO sou7vzXGui9yCuLlKzJV8pfrK8iGBuqWQC36XIwJom3I9nu5zfhWkFLz3ldCSCobRSTb f37jatxP7hg1XgPAaXI3jgjfGYgFbe0i/1faQ= Date: Sun, 14 Aug 2011 17:03:14 +0200 From: =?UTF-8?B?UmFmYWVsIER1csOhbiBDYXN0YcOxZWRh?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 MIME-Version: 1.0 To: python-list@python.org Subject: Re: login with urllib2 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1313334200 news.xs4all.nl 23918 [2001:888:2000:d::a6]:47775 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:11394 I'm not sure but you probably need using HTTPS handler, but without exact error code/message... On 14/08/11 16:50, 守株待兔 wrote: > please to see my code: > import urllib > import urllib2 > > url = 'http://hi.baidu.com/' > values = {'username' : '******','password' : '******' } > > data = urllib.urlencode(values) > req = urllib2.Request(url,data) > response = urllib2.urlopen(req) > the_page = response.read() > > i can't to login ,why?username and password are right. > any word appreciated.