baseurl = "https://trading1.sbisec.co.jp/ETGate/" def write(str): f = open("out.html", "w") f.write(str.encode("sjis")) f.close() def build_opener_cookie(cj): import urllib2 ch = urllib2.HTTPCookieProcessor(cj) opener = urllib2.build_opener(ch) return opener def get_form(opener): r = opener.open(baseurl) html = r.read().decode("sjis") return html def parse_form(html): from BeautifulSoup import Bea