Awesome, that worked -- thanks, Titus! By the way, I have researched similar libraries in Python, Ruby, AutoIt, JavaScript, and .NET, and found nothing currently comparable to twill in terms of the combination of power and friendliness.
Jamal -----Original Message----- From: C. Titus Brown [mailto:[email protected]] Sent: Thursday, September 03, 2009 10:31 PM To: Jamal Mazrui Cc: [email protected] Subject: Re: [twill] Downloading a binary file On Thu, Sep 03, 2009 at 06:04:22PM -0400, Jamal Mazrui wrote: -> I want to develop a web crawler with twill. What might be the best -> way to download non-HTML files while retaining state? For example, a -> script might log into a site and then search for particular .mp3 files there. -> I want cookies and the Referer header to be handled correctly when -> making a download request. I have found twill examples that save -> text/HTML but not binary files. Hi Jamal, try this: --- import twill b = twill.get_browser() b.go('http://some/url/') # <-- REPLACE WITH ACTUAL URL data = b.result.get_page() --- cheers, --titus -- C. Titus Brown, [email protected] _______________________________________________ twill mailing list [email protected] http://lists.idyll.org/listinfo/twill
