Since getPage just passes most of its’ args through to HTTPClientFactory, you can just make a simple wrapper to set the user-agent:

    from twisted.web.client import getPage
    ...
    def my_page_getter(*args, **kwargs):
        if 'agent' not in kwargs:
            kwargs['agent'] = 'your user agent/1.2'
        return getPage(*args, **kwargs)
blog comments powered by Disqus

IPv6 Accessible Powered by IkiWiki
Last edited late Tuesday evening, May 17th, 2011. © Rob Weir 2003-2011.