from grab import Grab import logging logging basicConfig level logging

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
from grab import Grab
import logging
logging.basicConfig(level=logging.DEBUG)
g = Grab()
g.setup(log_dir='log')
g.go('http://login.uid.me/?site=2l2dark&ref=http%3A//l2dark.at.ua/publ/4-1-0-31')
g.setup(post={'email': 'test@test.ru','pass': 'test'})
g.doc.submit(url='http://login.uid.me/dolog/')
g.submit(make_request=False)
g.go('http://login.uid.me/?site=2l2dark&ref=http%3A//l2dark.at.ua/publ/4-1-0-31')
g.go('http://l2dark.at.ua/news/0-0-0-0-1')
g.set_input('cat', '2')
g.doc.set_input('title', 'L2 Vanir | Your Lineage 2 server - L2 low rate server')
g.doc.set_input('message', '<a href="http://www.l2vanir.com/">$CUT$')
g.doc.submit(submit_name="sbm")
print g.response.body