Vor
Vor

Reputation: 35129

How to change User_Agent in PyQt4 QtWebkit

Right now it looks like this:

Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.34 (KHTML, like Gecko) Qt/4.8.1 Safari/534.34

But I would like to change it to something like this:

Nokia5320XpressMusic/GoBrowser/1.6.0.70

Upvotes: 0

Views: 109

Answers (1)

mata
mata

Reputation: 69042

The easiest way is to subclass QWebPage and override the userAgentForUrl - method, then you can tell the QWebView to use your implementation using setPage.

Upvotes: 1

Related Questions