def userAgentForUrl(self, url): if self._userAgent: agent = self._userAgent else: agent = QWebPage.userAgentForUrl(self,url) return agent