some site login problem help plz..

2009-10-05 Thread james27

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.



location.replace("http://www.naver.com";);



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':'13774',
   '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.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: some site login problem help plz..

2009-10-05 Thread james27

still looking for good solution.
anyway..thanks Diez :)

Diez B. Roggisch-2 wrote:
> 
> james27 wrote:
> 
>> 
>> 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.
>> 
>> 
>> 
>> location.replace("<a  rel="nofollow" href="http://www.naver.com"">http://www.naver.com"</a>;);
>> 
>> 
>> 
>> 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?
> 
> Your problem is that the site uses JavaScript to replace itself. Mechanize
> can't do anything about that. You might have more luck with scripting a
> browser. No idea if there are any special packages available for that
> though.
> 
> Diez
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 
> 

-- 
View this message in context: 
http://www.nabble.com/some-site-login-problem-help-plz..-tp25746497p25750229.html
Sent from the Python - python-list mailing list archive at Nabble.com.

-- 
http://mail.python.org/mailman/listinfo/python-list


POST value related question

2009-10-12 Thread james27

hello
im using mechanize .
i want to send some post value by use mechanize.
but problem is one of POST value in html source is 
looks like below.

post.category.categoryNo=[*1]

anyway so i was tried several method but all failed.

here is source .
.
.
br = mechanize.browser()
br.select_form(nr=0)   
br.form['post.category.categoryNo']=[*1]
br.form['contents.contentsValue'] = 'hello'
br.submit() 
.
.

if anyone who know please help me .
thanks in advance.

-- 
View this message in context: 
http://www.nabble.com/POST-value-related-question-tp25857587p25857587.html
Sent from the Python - python-list mailing list archive at Nabble.com.

-- 
http://mail.python.org/mailman/listinfo/python-list


twill unicode related

2009-10-13 Thread james27

hello
im learning twill,but have some problem with unicode.
whenever i use twill's follow function which emulate webbrowser link click
function,it can work well with 
english link,but can't work with unicode.
does anybody some know about this probelm? 
thank in advance
follow is sample

# -*- coding: cp949 -*-
import twill.commands as tc

tc.go("http://searchc.naver.com/pw/";)
tc.info()
tc.follow("unicode")
-- 
View this message in context: 
http://www.nabble.com/twill-unicode-related-tp25869251p25869251.html
Sent from the Python - python-list mailing list archive at Nabble.com.

-- 
http://mail.python.org/mailman/listinfo/python-list


cx_freeze install_exe error

2009-10-16 Thread james27

hello
im currently installed cx_freeze on linux.
and want to make win32 exe file on linux by use cx_freeze.
and then will distribute on widows platform.
one of my problem is ,i can build with no problem.
but whenever i run,it something weird error message was show.
follow is my log file.
anybody can help me ? thanks in advance
in addition if i use cx_freeze command option with 'install_exe', can i make
win32 executable file?

[code] 

r...@bt:/usr/lib/python2.5/site-packages/cx_Freeze-4.1/samples/simple# more
setup.py
# A very simple setup script to create a single executable
#
# hello.py is a very simple "Hello, world" type script which also displays
the
# environment in which the script runs
#
# Run the build process by running the command 'python setup.py build'
#
# If everything works well you should find a subdirectory in the build
# subdirectory that contains the files needed to run the script without
Python

from cx_Freeze import setup, Executable

setup(
name = "hello",
version = "0.1",
description = "Sample cx_Freeze script",
executables = [Executable("hello.py")])

r...@bt:/usr/lib/python2.5/site-packages/cx_Freeze-4.1/samples/simple# ls
hello.py  setup.py


r...@bt:/usr/lib/python2.5/site-packages/cx_Freeze-4.1/samples/simple#
python setup.py install_exe
running install_exe
running build_exe
creating directory build/exe.linux-i686-2.5
coyping /usr/lib/python2.5/site-packages/cx_Freeze/bases/Console ->
build/exe.linux-i686-2.5/hello
coyping /usr/lib/libpython2.5.so.1.0 ->
build/exe.linux-i686-2.5/libpython2.5.so.1.0
writing zip file build/exe.linux-i686-2.5/library.zip
m encodings.cp037
중간생략
copying build/exe.linux-i686-2.5/_multibytecodec.so -> /usr/lib/hello-0.1
copying build/exe.linux-i686-2.5/bz2.so -> /usr/lib/hello-0.1
copying build/exe.linux-i686-2.5/_codecs_kr.so -> /usr/lib/hello-0.1
copying build/exe.linux-i686-2.5/_codecs_cn.so -> /usr/lib/hello-0.1


r...@bt:/usr/lib/python2.5/site-packages/cx_Freeze-4.1/samples/simple# ls
build  hello.py  setup.py


r...@bt:/usr/lib/python2.5/site-packages/cx_Freeze-4.1/samples/simple# cd
build/


r...@bt:/usr/lib/python2.5/site-packages/cx_Freeze-4.1/samples/simple/build#
ls
exe.linux-i686-2.5


r...@bt:/usr/lib/python2.5/site-packages/cx_Freeze-4.1/samples/simple/build#
cd exe.linux-i686-2.5/


r...@bt:/usr/lib/python2.5/site-packages/cx_Freeze-4.1/samples/simple/build/exe.linux-i686-2.5#ls
_codecs_cn.so   _codecs_kr.so   array.so  hello   
unicodedata.so
_codecs_hk.so   _codecs_tw.so   binascii.so   itertools.so
zlib.so
_codecs_iso2022.so  _multibytecodec.so  bz2.solibpython2.5.so.1.0
_codecs_jp.so   _struct.so  cStringIO.so  library.zip


r...@bt:/usr/lib/python2.5/site-packages/cx_Freeze-4.1/samples/simple/build/exe.linux-i686-2.5#hello
Hello from cx_Freeze

Executable: '/usr/bin/hello'
Prefix: '/'
File system encoding: 'ANSI_X3.4-1968'

ARGUMENTS:
hello

PATH:
/usr/bin/../lib/hello-0.1/hello
/usr/bin/../lib/hello-0.1
/usr/bin/../lib/hello-0.1/hello.zip
/usr/bin/../lib/hello-0.1/library.zip 
[/code]
-- 
View this message in context: 
http://www.nabble.com/cx_freeze-install_exe-error-tp25930611p25930611.html
Sent from the Python - python-list mailing list archive at Nabble.com.

-- 
http://mail.python.org/mailman/listinfo/python-list


using cx_freeze on linux

2009-10-17 Thread james27

hi..
im new to cx_freeze .
i was searched much of time.but i couldn't found solution.
i want to make exe file which can run on windows.
is it possible to make windows exe file by use cx_freeze on linux?
if anyone can help ,much appreciate.
thanks 
-- 
View this message in context: 
http://www.nabble.com/using-cx_freeze-on-linux-tp25936152p25936152.html
Sent from the Python - python-list mailing list archive at Nabble.com.

-- 
http://mail.python.org/mailman/listinfo/python-list