some site login problem help plz..

james27 southpolepen at hotmail.com
Mon Oct 5 09:54:09 CEST 2009


hello..
im new to python.
i have some problem with mechanize.
before i was used mechanize with no problem.
but i couldn't success login with some site.
for several days i was looked for solution but failed.
my problem is , login is no probelm but can't retrieve html source code from
opened site.
actually only can read some small html code, such like below.

<html>
<script language=javascript>
location.replace("http://www.naver.com");
</script>
</html>

i want to retrive full html source code..but i can't . i was try with twill
and mechanize and urllib and so on.
i have no idea.. anyone can help me?

here is full source code.
and Thanks in advance!

# -*- coding: cp949 -*-
import sys,os
import mechanize, urllib
import cookielib
import re
import BeautifulSoup

params = urllib.urlencode({'url':'http://www.naver.com',
                                   'svctype':'',
                                   'viewtype':'',
                                   'postDataKey':'',
                                  
'encpw':'3a793b174d976d8a614467eb0466898230f39ca68a8ce2e9c866f9c303e7c96a17c0e9bfd02b958d88712f5799abc5d26d5b6e2dfa090e10e236f2afafb723d42d2a2aba6cc3f268e214a169086af782c22d0c440c876a242a4411860dd938c4051acce987',
                                   'encnm':'100003774',
                                   'saveID':'0',
                                   'enctp':'1',
                                   'smart_level':'1',
                                   'id':'lbu142vj',
                                   'pw':'wbelryl',
                                   'x':'24',
                                   'y':'4'
                                   })
rq = mechanize.Request("http://nid.naver.com/nidlogin.login", params)
rs = mechanize.urlopen(rq)
data = rs.read()   
print data     
rq = mechanize.Request("http://mail2.naver.com")
rs = mechanize.urlopen(rq)
data = rs.read()
print data 
-- 
View this message in context: http://www.nabble.com/some-site-login-problem-help-plz..-tp25746497p25746497.html
Sent from the Python - python-list mailing list archive at Nabble.com.




More information about the Python-list mailing list