how to change user agent randomly?

33 views
Skip to first unread message

Avnesh Shakya

unread,
May 20, 2013, 7:20:45 AM5/20/13
to beauti...@googlegroups.com
hi,
    how to change my user agent randomly? Actually I want to extract data from other site and I want to change my user agent when i am extracting data from there.
   I mean that i will extract from firefox but it should show different agent like chrome or internet explorer. so i want to sent different agent when i open a url for extracting data.
   please suggest me a way or python module or link, so that i could do it..
  
  Thanks.

Aaron DeVore

unread,
May 20, 2013, 12:32:29 PM5/20/13
to beauti...@googlegroups.com
I think you're looking for the urllib2 module (urllib.request in Python 3). Specifically:

http://docs.python.org/2/library/urllib2.html#urllib2.Request

-Aaron DeVore



--
You received this message because you are subscribed to the Google Groups "beautifulsoup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beautifulsou...@googlegroups.com.
To post to this group, send email to beauti...@googlegroups.com.
Visit this group at http://groups.google.com/group/beautifulsoup?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages