如何修改 selenium中IE driver的user-agent?
selenium的IE Driver,默认的user-agent为:
Python http auth
具体的header如下:
GET / HTTP/1.1
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: zh-CN
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
Host: wobss.sdinfo.net
POST /session/34214242-c366-4556-be0e-3a1aa562bb9f/timeouts/implicit_wait HTTP/1.1
Accept-Encoding: identity
Content-Length: 68
Host: 127.0.0.1:62412
Accept: application/json
User-Agent: Python http auth
Connection: close
Content-Type: application/json;charset=UTF-8
这就造成一些网站给予了屏蔽,如何修改user agent?