0

I want to login into gmail with an account and perform some actions and sign out of it and login with different account(from my account list) but this time with different originating IP.

 with open('mygmailAccounts.json', 'r') as f:    
    accountsList = json.loads(f.read())

 driver = webdriver.Firefox();
 for eachaccount in accountlist:
    gmail_Login();

Is it possible that when script try to login with different account, call should go with different IP? Any help will highly appreciated.

1

Use a proxy server, like this with chromedriver and Python

options = Options()
options.add_argument('--proxy-server=46.102.106.37:13228')
browser = webdriver.Chrome(executable_path='ChromeDriverPath', chrome_options=options)

options = Options()
options.add_argument('--proxy-server=46.102.106.37:13228')
browser = webdriver.Chrome(executable_path='ChromeDriverPath', chrome_options=options)
  • Both set looks identical. is this how I should use it?? Also, please confirm if this proxy snippet will switch the driver to new IP on each call? – user3121891 Apr 21 '18 at 17:59
  • I believe these options work for a browser session. – Alexey R. Apr 23 '18 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.