0

Hey all trust that you're well, I'm currently receiving a Code is unreachable, it seems to work when I remove mobile emulation, however I need mobile emulation

Code:

def test_instance(data, tgs):

    Options = webdriver.ChromeOptions()

    mobile_emulation = {"userAgent": "Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/102.0.5005.63 Mobile Safari/535.19"}

    Options.add_experimental_option("mobileEmulation", mobile_emulation)

    Options.add_argument("--log-level=3")
    #Options.add_argument("--headless")
    #Options.add_argument("--remote-debugging-port=9222")
    #Options.add_argument('--no-sandbox')

Error:

Code is unreachablePylance
Don Eros
  • 55
  • 5
  • what are you trying to achieve exactly?? can you be more specific please – ahmed mani Jun 04 '22 at 00:31
  • Hey @ahmedmani I've developed a bot that requires mobile emulation, and it recently started giving me the unreachable error I'm trying to resolve this, I've found that when I remove mobile emulation it seems to work. – Don Eros Jun 04 '22 at 00:59
  • by a mobile emulation do you mean a bot that runs on a android emulator? if so what are you trying to do automate a app or a website? – ahmed mani Jun 04 '22 at 01:33
  • @ahmedmani Selenium Instagram bot – Don Eros Jun 04 '22 at 02:14
  • 1
    you're simply getting the mobile site back for instagram.com you can use the desktop site there isn't much advantages to using mobile website instead of desktop site – ahmed mani Jun 04 '22 at 15:00

0 Answers0