Your login information like cookies are stored in chrome profile.
so to avoid re login prompts . Use the default profile which you uses for logging into gmail.
user-data-dir considers profile as default , and you don't have to specify that . If its something else specify it through profile-directory argument
Step to know profile path:
open : chrome://version in address bar
Now to use this :
chrom_options.add_argument("user-data-dir=C:\Users\AppData\Local\Google\Chrome\User Data")
Note; you should give only till user data don't need to specify user dataDefault
Update:
copy the user data folder completely to eg c:mp
ewdir
open the copied user data (newdir) and search for folder called Default . This is the profile folder.
Now to use this :
chrom_options.add_argument("user-data-dir=c:\tmp\newdir")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…