Python: urllib/urllib2/httplib confusion

后端 未结 8 1863
长情又很酷
长情又很酷 2020-12-04 07:01

I\'m trying to test the functionality of a web app by scripting a login sequence in Python, but I\'m having some troubles.

Here\'s what I need to do:

  1. D
8条回答
  •  臣服心动
    2020-12-04 07:12

    Try twill - a simple language that allows users to browse the Web from a command-line interface. With twill, you can navigate through Web sites that use forms, cookies, and most standard Web features. More to the point, twill is written in Python and has a python API, e.g:

    from twill import get_browser
    b = get_browser()
    
    b.go("http://www.python.org/")
    b.showforms()
    

提交回复
热议问题