Setting user data/profile in Selenium is not working. Selenium Python

前端 未结 1 848
孤独总比滥情好
孤独总比滥情好 2021-01-28 16:11

For some reason when I try to set my user data/profile it doesn\'t work. The code runs fine but once the browser launches I\'m not logged in to my profile. How would I go about

相关标签:
1条回答
  • 2021-01-28 16:23

    Just remove Profile 1 from user-data-dir=xxx, then try again


    More information:

    1. Open chrome://version in the browser to see what profile Chrome is using. such as C:\Users\quanql\AppData\Local\Google\Chrome\User Data\Default
    2. remove the Default at the end and use it as value of user-data-dir=. such as user-data-dir=C:/Users/quanql/AppData/Local/Google/Chrome/User Data/
    3. run the test case, it should work

    If you do not remove the Default in the 2nd step, then while you are running test case, open chrome://version in the browser which launched by chromedriver, you will see the profile Chrome that is using is C:\Users\quanql\AppData\Local\Google\Chrome\User Data\Default\Default. This is the reason, you just met the same problem.

    0 讨论(0)
提交回复
热议问题