how to change default user agent in python spynner module?

505 views Asked by At

I get a syntax error for the following code:

import spynner

browser = spynner.Browser( (['User-Agent', 'foobar')]) 

How can I change the default user agent in the python spynner module?

1

There are 1 answers

0
irqed On BEST ANSWER

You get syntax error because of unmatched brackets. To change default user agent you can use user_agent argument. Here's an example: https://github.com/makinacorpus/spynner/blob/c205db628ac41c46f3df07345f547f0fa8ee25ff/examples/proxy.py#L22