0

It honestly frustrates me that after several attempts at solutions google still gives me this error:

enter image description here

Since there was a similar post about this question, I thought to try the solutions given by https://stackoverflow.com/a/60117617/12556138, however to no avail the solutions he provided did not work, because I tried to do exactly the ff:

a. adding the ff. options to my code

edge_options.add_argument("--disable-web-security")
edge_options.add_argument("--allow-running-insecure-content")
edge_options.add_argument("--user-data-dir=C:/Users/Mig/AppData/Local/Google/Chrome/User Data/Profile 1")

b. turning off 2-factor authentication

c. tried turning on less secure apps but I've researched that google already has removed the option to allow connections from less secure apps starting from May 30 2022. That you have to enable 2-step verification on your Google account and generate an app password123 to use Google SMTP server or other third-party apps that require Google sign-in, which is a direct contradiction to solution b.

d. JavaScript is always turned on in my Edge browser

e. tried also deleting all the history and saved data on my browser

f. tried signing my google account out of all devices remotely in https://myaccount.google.com/

The following are also my error messages:

[<some token>/184906.747:ERROR:chrome_browser_cloud_management_controller.cc(162)] Cloud management controller initialization aborted as CBCM is not enabled.
[<some token>/184906.769:ERROR:assistance_home_client.cc(32)] File path C:\Users\Mig\AppData\Local\Temp\scoped_dir1308_592920665\Default

DevTools listening on ws://127.0.0.1:<some token>
[<some token>/184908.140:ERROR:fallback_task_provider.cc(124)] Every renderer should have at least one task provided by a primary task provider. If a "Renderer" fallback task is shown, it is a bug. If you have repro steps, please file a new bug and tag it as a dependency of crbug.com/739782.
[<some token>/184909.398:ERROR:smartscreen_dns_resolver.cc(110)] SmartScreenDnsResolver::OnComplete Error: -7 DidTimeOut: 1 URL: https://www.linkedin.com/mynetwork/invite-connect/connections/
done!
[<some token>/184912.991:ERROR:gpu_disk_cache.cc(216)] Failed to create blob cache entry: -2

(gmail-automations) D:\Projects\To Github\auto-job-app-sender>[<some token>/184918.305:ERROR:device_event_log_impl.cc(222)] [18:49:18.305] Bluetooth: bluetooth_adapter_winrt.cc:1058 Getting Default Adapter failed.

Below is my main python script:

def main():
    # # if using chrome
    # chrome_options = ChromeOptions()
    # chrome_options.add_experimental_option('detach', True)
    # service = ChromeService(executable_path=ChromeDriverManager().install())
    # driver = webdriver.Chrome(service=service, options=chrome_options)

    # if using edge
    edge_options = EdgeOptions()
    edge_options.add_experimental_option('detach', True)
    # edge_options.add_argument("--disable-web-security")
    # edge_options.add_argument("--allow-running-insecure-content")
    # edge_options.add_argument("--user-data-dir=C:/Users/Mig/AppData/Local/Google/Chrome/User Data/Profile 1")
    # edge_options.add_argument("--profile-directory=Default")
    service = EdgeService(executable_path=EdgeChromiumDriverManager().install())
    driver = webdriver.Edge(service=service, options=edge_options)


    
    links_to_connections = collect_links_to_connections(driver=driver, link="https://www.linkedin.com/mynetwork/invite-connect/connections/")
    # collect_recruiter_info(driver, links)

I also had a colleague sign in to his linked in via his google account and mind you that his account had two-factor authentication enabled so that begs the question. What is wrong with my google account or my code for that matter that doesn't allow me to sign in to my google account using selenium web driver even if I had two-factor authentication disabled?

Shawn
  • 4,064
  • 2
  • 11
  • 23
  • They can tell you're trying to log in from something suspicious (selenium). I would try loading cookies exported from a good session or using oauth app to get what you want – pguardiario Aug 16 '23 at 00:15

1 Answers1

1

I can reproduce the issue on my side. I think we can't use selenium WebDriver to control auto-login in LinkedIn Google Account. Google should have detected using WebDriver so further operations are blocked.

You can use the Edge profile that is logged into your LinkedIn Google Account as a workaround. Then you just need to procced to the URL https://www.linkedin.com/mynetwork/invite-connect/connections/, no need to login again.

You can find the profile path in edge://version/ and use that profile like below in your code:

edge_options.add_argument("user-data-dir=C:\\Users\\Administrator\\AppData\\Local\\Microsoft\\Edge\\User Data")
edge_options.add_argument("profile-directory=Profile 1")
Yu Zhou
  • 11,532
  • 1
  • 8
  • 22
  • I tried and it opened my edge browser in my account however a ```selenium.common.exceptions.WebDriverException: Message: unknown error: Microsoft Edge failed to start: exited normally. (unknown error: DevToolsActivePort file doesn't exist)``` occured so not sure how to deal with this yet I'm still researching it so far the thigns I've found were to add arguments such as `"--no-sandbox"` and `"--disable-dev-shm-usage"` – Mig Rivera Cueva Aug 16 '23 at 12:00
  • You can try to kill all processes of Edge at first using command line: `taskkill /F /IM msedge.exe`, then run the Python script. And you can also refer to my answer in [this thread](https://stackoverflow.com/questions/66682566/ms-edge-driver-error-devtoolsactiveport-file-doesnt-exist-works-only-with/66686095#66686095). – Yu Zhou Aug 17 '23 at 01:59