Re: mechanize login problem with website

Discussion in 'Python' started by elca, Nov 19, 2009.

  1. elca

    elca Guest

    elca wrote:
    >
    > Hello
    >
    > I'm making auto-login script by use mechanize python.
    >
    > Before I was used mechanize with no problem, but http://www.gmarket.co.kr
    > in this site I couldn't make it .
    >
    > whenever i try to login always login page was returned even with correct
    > gmarket id , pass, i can't login and I saw some suspicious message
    >
    > "<script language=javascript>top.location.reload();</script>"
    >
    > I think this related with my problem, but don't know exactly how to handle
    > .
    >
    > i was upload my script in here
    >
    > # -*- coding: cp949 -*-
    > from lxml.html import parse, fromstring
    > import sys,os
    > import mechanize, urllib
    > import cookielib
    > import re
    > from BeautifulSoup import BeautifulSoup,BeautifulStoneSoup,Tag
    >
    > try:
    >
    > params = urllib.urlencode({'command':'login',
    > 'url':'http%3A%2F%2Fwww.gmarket.co.kr%2F',
    > 'member_type':'mem',
    > 'member_yn':'Y',
    > 'login_id':'tgi177',
    > 'image1.x':'31',
    > 'image1.y':'26',
    > 'passwd':'tk1047',
    > 'buyer_nm':'',
    > 'buyer_tel_no1':'',
    > 'buyer_tel_no2':'',
    > 'buyer_tel_no3':''
    >
    > })
    > rq = mechanize.Request("http://www.gmarket.co.kr/challenge/login.asp")
    > rs = mechanize.urlopen(rq)
    > data = rs.read()
    >
    >
    > logged_in = r'input_login_check_value' in data
    > if logged_in:
    > print ' login success !'
    > rq = mechanize.Request("http://www.gmarket.co.kr")
    > rs = mechanize.urlopen(rq)
    > data = rs.read()
    > print data
    >
    > else:
    > print 'login failed!'
    > pass
    > quit()
    > except:
    > pass
    >
    >
    > if anyone can help me much appreciate thanks in advance
    >
    >

    i was updated my script source
    --
    View this message in context: http://old.nabble.com/mechanize-login-problem-with-website-tp26420202p26421474.html
    Sent from the Python - python-list mailing list archive at Nabble.com.
    elca, Nov 19, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rockdale
    Replies:
    5
    Views:
    685
    Chad Scharf
    Jul 5, 2007
  2. elca
    Replies:
    0
    Views:
    524
  3. Md.elme focruzzaman Shuvo

    Need Help in Aol Login with mechanize

    Md.elme focruzzaman Shuvo, Jun 17, 2007, in forum: Ruby
    Replies:
    0
    Views:
    128
    Md.elme focruzzaman Shuvo
    Jun 17, 2007
  4. Frioffol Friofool
    Replies:
    0
    Views:
    238
    Frioffol Friofool
    Oct 4, 2007
  5. Pen Ttt

    mechanize login problem

    Pen Ttt, Jun 20, 2010, in forum: Ruby
    Replies:
    1
    Views:
    209
    Pen Ttt
    Jun 23, 2010
Loading...

Share This Page