Search code examples
pythonpyqt5qtwebengine

PyQt5 Web Engine Google Sign in


I'm creating a browser using the PyQt5 Web Engine, however when I try to sign in via google, I'm getting the following message: The error I'm getting

I've tried many of the solutions on StackOverflow, including This one however they aren't making a difference.

The code I'm currently running (excluding functions and classes):

import os
import sys

from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *

from PyQt5.QtWebEngineWidgets import *


app = QApplication(sys.argv)
app.setApplicationName("Browser")

window = MainWindow()
app.exec_()

Please tell me what I may be doing wrong, thanks.


Solution

  • Just managed to find a solution, under where I had browser = QWebEngineView(), I put in an User agent:

    browser.page().profile().setHttpUserAgent(
                "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0"
            )
    

    This worked for me, though it took a lot of research