Note that there are some explanatory texts on larger screens.

plurals
  1. POpython mechanize.browser submit() related problem
    primarykey
    data
    text
    <p>im making some script with mechanize.browser module.</p> <p>one of problem is all other thing is ok, but when submit() form,it not working,</p> <p>so i was found some suspicion source part.</p> <p>in the html source i was found such like following.</p> <pre><code>&lt;form method="post" onsubmit="return loginCheck(this)" name="FRMLOGIN"/&gt; </code></pre> <p>im thinking, loginCheck(this) making problem when submit form.</p> <p>but how to handle this kind of javascript function with mechanize module ,so i can </p> <p>successfully submit form and can receive result?</p> <p>folloing is my current script source.</p> <p>if anyone can help me ..much appreciate!!</p> <pre><code># -*- coding: cp949-*- import sys,os import mechanize, urllib import cookielib from BeautifulSoup import BeautifulSoup,BeautifulStoneSoup,Tag import datetime, time, socket import re,sys,os,mechanize,urllib,time br = mechanize.Browser() cj = cookielib.LWPCookieJar() br.set_cookiejar(cj) # Browser options br.set_handle_equiv(True) br.set_handle_gzip(True) br.set_handle_redirect(True) br.set_handle_referer(True) br.set_handle_robots(False) # Follows refresh 0 but not hangs on refresh &gt; 0 br.set_handle_refresh(mechanize._http.HTTPRefreshProcessor(), max_time=1) # Want debugging messages? br.set_debug_http(True) br.set_debug_redirects(True) br.set_debug_responses(True) # User-Agent (this is cheating, ok?) br.addheaders = [('User-agent', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.6')] br.open('http://user.buddybuddy.co.kr/Login/LoginForm.asp?URL=') html = br.response().read() print html br.select_form(name='FRMLOGIN') print br.viewing_html() br.form['ID']='zero1zero2' br.form['PWD']='012045' br.submit() print br.response().read() </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload