Using Selenium to login to Gmail/save cookies and then use requests
I am trying to sign into Gmail using Selenium and then using requests (or aiohttp) to do Google searches.
Before all this, I was using pure Selenium to log in and do searches, watch YouTube etc. However recently I began to ask if I could use pure requests to sign into Gmail. I was told that was extremely hard due to a large amount of JavaScript being used. So I thought of a new way (using Selenium to log in and then proceed to use requests) and wanted to see if it would work.
driver = webdriver.Chrome()
driver.get("https://accounts.google.com/signin")
email_phone = driver.find_element_by_xpath("//input[@id='identifierId']")
email_phone.send_keys("your_emailid_phone")
driver.find_element_by_id("identifierNext").click()
password = WebDriverWait(driver, 5).until(
EC.element_to_be_clickable((By.XPATH, "//input[@name='password']")))
password.send_keys("your_password")
driver.find_element_by_id("passwordNext").click()
time.sleep(5)
driver.get("https://google.com")
pickle.dump( driver.get_cookies() , open("cookies.pkl","wb"))
session = requests.session()
with open('cookies.pkl', 'rb') as f:
session.cookies.update(pickle.load(f))
session.get("https://youtube.com")
There are no errors when running this code. However, I was concerned about whether this approach will work. If I load the cookies that were there when I signed into Gmail (using Selenium) will any activity I do reflect on my Gmail (my intention).
python python-3.x selenium beautifulsoup python-requests
add a comment |
I am trying to sign into Gmail using Selenium and then using requests (or aiohttp) to do Google searches.
Before all this, I was using pure Selenium to log in and do searches, watch YouTube etc. However recently I began to ask if I could use pure requests to sign into Gmail. I was told that was extremely hard due to a large amount of JavaScript being used. So I thought of a new way (using Selenium to log in and then proceed to use requests) and wanted to see if it would work.
driver = webdriver.Chrome()
driver.get("https://accounts.google.com/signin")
email_phone = driver.find_element_by_xpath("//input[@id='identifierId']")
email_phone.send_keys("your_emailid_phone")
driver.find_element_by_id("identifierNext").click()
password = WebDriverWait(driver, 5).until(
EC.element_to_be_clickable((By.XPATH, "//input[@name='password']")))
password.send_keys("your_password")
driver.find_element_by_id("passwordNext").click()
time.sleep(5)
driver.get("https://google.com")
pickle.dump( driver.get_cookies() , open("cookies.pkl","wb"))
session = requests.session()
with open('cookies.pkl', 'rb') as f:
session.cookies.update(pickle.load(f))
session.get("https://youtube.com")
There are no errors when running this code. However, I was concerned about whether this approach will work. If I load the cookies that were there when I signed into Gmail (using Selenium) will any activity I do reflect on my Gmail (my intention).
python python-3.x selenium beautifulsoup python-requests
1
So, what you want to do actually?
– Ratmir Asanov
Dec 28 '18 at 8:45
1
Why not use this? developers.google.com/gmail/api/quickstart/python
– kcorlidy
Dec 28 '18 at 8:48
@RatmirAsanov what I am trying to do is login to Gmail (using Selenium), save the cookies that are there when I am logged into Gmail, and then proceed to use those cookies in requests to search google,watch youtube etc. The point is to minimize the amount of Selenium possible.
– Joell
Dec 28 '18 at 17:47
@kcorlidy I can use that API, but from what I read in the description its basically like selenium in the sense that it creates a new browser session etc. I am much more familiar with selenium than Google's API hence my choice.
– Joell
Dec 28 '18 at 17:53
add a comment |
I am trying to sign into Gmail using Selenium and then using requests (or aiohttp) to do Google searches.
Before all this, I was using pure Selenium to log in and do searches, watch YouTube etc. However recently I began to ask if I could use pure requests to sign into Gmail. I was told that was extremely hard due to a large amount of JavaScript being used. So I thought of a new way (using Selenium to log in and then proceed to use requests) and wanted to see if it would work.
driver = webdriver.Chrome()
driver.get("https://accounts.google.com/signin")
email_phone = driver.find_element_by_xpath("//input[@id='identifierId']")
email_phone.send_keys("your_emailid_phone")
driver.find_element_by_id("identifierNext").click()
password = WebDriverWait(driver, 5).until(
EC.element_to_be_clickable((By.XPATH, "//input[@name='password']")))
password.send_keys("your_password")
driver.find_element_by_id("passwordNext").click()
time.sleep(5)
driver.get("https://google.com")
pickle.dump( driver.get_cookies() , open("cookies.pkl","wb"))
session = requests.session()
with open('cookies.pkl', 'rb') as f:
session.cookies.update(pickle.load(f))
session.get("https://youtube.com")
There are no errors when running this code. However, I was concerned about whether this approach will work. If I load the cookies that were there when I signed into Gmail (using Selenium) will any activity I do reflect on my Gmail (my intention).
python python-3.x selenium beautifulsoup python-requests
I am trying to sign into Gmail using Selenium and then using requests (or aiohttp) to do Google searches.
Before all this, I was using pure Selenium to log in and do searches, watch YouTube etc. However recently I began to ask if I could use pure requests to sign into Gmail. I was told that was extremely hard due to a large amount of JavaScript being used. So I thought of a new way (using Selenium to log in and then proceed to use requests) and wanted to see if it would work.
driver = webdriver.Chrome()
driver.get("https://accounts.google.com/signin")
email_phone = driver.find_element_by_xpath("//input[@id='identifierId']")
email_phone.send_keys("your_emailid_phone")
driver.find_element_by_id("identifierNext").click()
password = WebDriverWait(driver, 5).until(
EC.element_to_be_clickable((By.XPATH, "//input[@name='password']")))
password.send_keys("your_password")
driver.find_element_by_id("passwordNext").click()
time.sleep(5)
driver.get("https://google.com")
pickle.dump( driver.get_cookies() , open("cookies.pkl","wb"))
session = requests.session()
with open('cookies.pkl', 'rb') as f:
session.cookies.update(pickle.load(f))
session.get("https://youtube.com")
There are no errors when running this code. However, I was concerned about whether this approach will work. If I load the cookies that were there when I signed into Gmail (using Selenium) will any activity I do reflect on my Gmail (my intention).
python python-3.x selenium beautifulsoup python-requests
python python-3.x selenium beautifulsoup python-requests
edited Dec 28 '18 at 8:44
Ratmir Asanov
3,0933823
3,0933823
asked Dec 28 '18 at 3:26
Joell
225
225
1
So, what you want to do actually?
– Ratmir Asanov
Dec 28 '18 at 8:45
1
Why not use this? developers.google.com/gmail/api/quickstart/python
– kcorlidy
Dec 28 '18 at 8:48
@RatmirAsanov what I am trying to do is login to Gmail (using Selenium), save the cookies that are there when I am logged into Gmail, and then proceed to use those cookies in requests to search google,watch youtube etc. The point is to minimize the amount of Selenium possible.
– Joell
Dec 28 '18 at 17:47
@kcorlidy I can use that API, but from what I read in the description its basically like selenium in the sense that it creates a new browser session etc. I am much more familiar with selenium than Google's API hence my choice.
– Joell
Dec 28 '18 at 17:53
add a comment |
1
So, what you want to do actually?
– Ratmir Asanov
Dec 28 '18 at 8:45
1
Why not use this? developers.google.com/gmail/api/quickstart/python
– kcorlidy
Dec 28 '18 at 8:48
@RatmirAsanov what I am trying to do is login to Gmail (using Selenium), save the cookies that are there when I am logged into Gmail, and then proceed to use those cookies in requests to search google,watch youtube etc. The point is to minimize the amount of Selenium possible.
– Joell
Dec 28 '18 at 17:47
@kcorlidy I can use that API, but from what I read in the description its basically like selenium in the sense that it creates a new browser session etc. I am much more familiar with selenium than Google's API hence my choice.
– Joell
Dec 28 '18 at 17:53
1
1
So, what you want to do actually?
– Ratmir Asanov
Dec 28 '18 at 8:45
So, what you want to do actually?
– Ratmir Asanov
Dec 28 '18 at 8:45
1
1
Why not use this? developers.google.com/gmail/api/quickstart/python
– kcorlidy
Dec 28 '18 at 8:48
Why not use this? developers.google.com/gmail/api/quickstart/python
– kcorlidy
Dec 28 '18 at 8:48
@RatmirAsanov what I am trying to do is login to Gmail (using Selenium), save the cookies that are there when I am logged into Gmail, and then proceed to use those cookies in requests to search google,watch youtube etc. The point is to minimize the amount of Selenium possible.
– Joell
Dec 28 '18 at 17:47
@RatmirAsanov what I am trying to do is login to Gmail (using Selenium), save the cookies that are there when I am logged into Gmail, and then proceed to use those cookies in requests to search google,watch youtube etc. The point is to minimize the amount of Selenium possible.
– Joell
Dec 28 '18 at 17:47
@kcorlidy I can use that API, but from what I read in the description its basically like selenium in the sense that it creates a new browser session etc. I am much more familiar with selenium than Google's API hence my choice.
– Joell
Dec 28 '18 at 17:53
@kcorlidy I can use that API, but from what I read in the description its basically like selenium in the sense that it creates a new browser session etc. I am much more familiar with selenium than Google's API hence my choice.
– Joell
Dec 28 '18 at 17:53
add a comment |
1 Answer
1
active
oldest
votes
If you insist using selenium, so you should know
passwordshould not beWebDriverWait(driver, ....WebDriverWait(driver, ...will return nothing useful for you in this case. Also it raises error when it can't find specific element in time limit.- You have to save cookie and expiry together, so you can get new one again when you really need it
- Be careful the issue of domain. In your case you access Google main site finally, which means if you use
driver.get_cookies()after that, you can not get the cookies which belong tohttps://myaccount.google.com/
Full code
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
import pickle
def save_cookies():
email = "@gmail.com"
password = ""
driver = webdriver.Chrome()
driver.get("https://accounts.google.com/signin")
email_phone = driver.find_element_by_xpath("//input[@id='identifierId']")
email_phone.send_keys(email)
driver.find_element_by_id("identifierNext").click()
WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.XPATH, "//input[@name='password']")))
password = driver.find_element_by_xpath("//input[@name='password']")
password.send_keys(password)
driver.find_element_by_id("passwordNext").click()
time.sleep(5)
google_cookies = driver.get_cookies()
cookies = ({cookie.get("name"):cookie.get("value") for cookie in google_cookies}, google_cookies[0].get("expiry"))
with open("cookies.pkl","wb") as fd:
pickle.dump(cookies, fd)
return cookies
import requests
with requests.Session() as s:
with open("cookies.pkl","rb") as fd:
cookies, expiry = pickle.load(fd)
if expiry < time.time():
cookies, expiry = save_cookies()
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"Referer": "https://www.google.com/",
"Accept-Encoding": "deflate",
"Accept-Language": "en;q=0.6",
}
resp = s.get("https://myaccount.google.com/"
,headers=headers,cookies=cookies)
print(resp.url)
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53953343%2fusing-selenium-to-login-to-gmail-save-cookies-and-then-use-requests%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you insist using selenium, so you should know
passwordshould not beWebDriverWait(driver, ....WebDriverWait(driver, ...will return nothing useful for you in this case. Also it raises error when it can't find specific element in time limit.- You have to save cookie and expiry together, so you can get new one again when you really need it
- Be careful the issue of domain. In your case you access Google main site finally, which means if you use
driver.get_cookies()after that, you can not get the cookies which belong tohttps://myaccount.google.com/
Full code
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
import pickle
def save_cookies():
email = "@gmail.com"
password = ""
driver = webdriver.Chrome()
driver.get("https://accounts.google.com/signin")
email_phone = driver.find_element_by_xpath("//input[@id='identifierId']")
email_phone.send_keys(email)
driver.find_element_by_id("identifierNext").click()
WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.XPATH, "//input[@name='password']")))
password = driver.find_element_by_xpath("//input[@name='password']")
password.send_keys(password)
driver.find_element_by_id("passwordNext").click()
time.sleep(5)
google_cookies = driver.get_cookies()
cookies = ({cookie.get("name"):cookie.get("value") for cookie in google_cookies}, google_cookies[0].get("expiry"))
with open("cookies.pkl","wb") as fd:
pickle.dump(cookies, fd)
return cookies
import requests
with requests.Session() as s:
with open("cookies.pkl","rb") as fd:
cookies, expiry = pickle.load(fd)
if expiry < time.time():
cookies, expiry = save_cookies()
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"Referer": "https://www.google.com/",
"Accept-Encoding": "deflate",
"Accept-Language": "en;q=0.6",
}
resp = s.get("https://myaccount.google.com/"
,headers=headers,cookies=cookies)
print(resp.url)
add a comment |
If you insist using selenium, so you should know
passwordshould not beWebDriverWait(driver, ....WebDriverWait(driver, ...will return nothing useful for you in this case. Also it raises error when it can't find specific element in time limit.- You have to save cookie and expiry together, so you can get new one again when you really need it
- Be careful the issue of domain. In your case you access Google main site finally, which means if you use
driver.get_cookies()after that, you can not get the cookies which belong tohttps://myaccount.google.com/
Full code
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
import pickle
def save_cookies():
email = "@gmail.com"
password = ""
driver = webdriver.Chrome()
driver.get("https://accounts.google.com/signin")
email_phone = driver.find_element_by_xpath("//input[@id='identifierId']")
email_phone.send_keys(email)
driver.find_element_by_id("identifierNext").click()
WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.XPATH, "//input[@name='password']")))
password = driver.find_element_by_xpath("//input[@name='password']")
password.send_keys(password)
driver.find_element_by_id("passwordNext").click()
time.sleep(5)
google_cookies = driver.get_cookies()
cookies = ({cookie.get("name"):cookie.get("value") for cookie in google_cookies}, google_cookies[0].get("expiry"))
with open("cookies.pkl","wb") as fd:
pickle.dump(cookies, fd)
return cookies
import requests
with requests.Session() as s:
with open("cookies.pkl","rb") as fd:
cookies, expiry = pickle.load(fd)
if expiry < time.time():
cookies, expiry = save_cookies()
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"Referer": "https://www.google.com/",
"Accept-Encoding": "deflate",
"Accept-Language": "en;q=0.6",
}
resp = s.get("https://myaccount.google.com/"
,headers=headers,cookies=cookies)
print(resp.url)
add a comment |
If you insist using selenium, so you should know
passwordshould not beWebDriverWait(driver, ....WebDriverWait(driver, ...will return nothing useful for you in this case. Also it raises error when it can't find specific element in time limit.- You have to save cookie and expiry together, so you can get new one again when you really need it
- Be careful the issue of domain. In your case you access Google main site finally, which means if you use
driver.get_cookies()after that, you can not get the cookies which belong tohttps://myaccount.google.com/
Full code
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
import pickle
def save_cookies():
email = "@gmail.com"
password = ""
driver = webdriver.Chrome()
driver.get("https://accounts.google.com/signin")
email_phone = driver.find_element_by_xpath("//input[@id='identifierId']")
email_phone.send_keys(email)
driver.find_element_by_id("identifierNext").click()
WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.XPATH, "//input[@name='password']")))
password = driver.find_element_by_xpath("//input[@name='password']")
password.send_keys(password)
driver.find_element_by_id("passwordNext").click()
time.sleep(5)
google_cookies = driver.get_cookies()
cookies = ({cookie.get("name"):cookie.get("value") for cookie in google_cookies}, google_cookies[0].get("expiry"))
with open("cookies.pkl","wb") as fd:
pickle.dump(cookies, fd)
return cookies
import requests
with requests.Session() as s:
with open("cookies.pkl","rb") as fd:
cookies, expiry = pickle.load(fd)
if expiry < time.time():
cookies, expiry = save_cookies()
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"Referer": "https://www.google.com/",
"Accept-Encoding": "deflate",
"Accept-Language": "en;q=0.6",
}
resp = s.get("https://myaccount.google.com/"
,headers=headers,cookies=cookies)
print(resp.url)
If you insist using selenium, so you should know
passwordshould not beWebDriverWait(driver, ....WebDriverWait(driver, ...will return nothing useful for you in this case. Also it raises error when it can't find specific element in time limit.- You have to save cookie and expiry together, so you can get new one again when you really need it
- Be careful the issue of domain. In your case you access Google main site finally, which means if you use
driver.get_cookies()after that, you can not get the cookies which belong tohttps://myaccount.google.com/
Full code
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
import pickle
def save_cookies():
email = "@gmail.com"
password = ""
driver = webdriver.Chrome()
driver.get("https://accounts.google.com/signin")
email_phone = driver.find_element_by_xpath("//input[@id='identifierId']")
email_phone.send_keys(email)
driver.find_element_by_id("identifierNext").click()
WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.XPATH, "//input[@name='password']")))
password = driver.find_element_by_xpath("//input[@name='password']")
password.send_keys(password)
driver.find_element_by_id("passwordNext").click()
time.sleep(5)
google_cookies = driver.get_cookies()
cookies = ({cookie.get("name"):cookie.get("value") for cookie in google_cookies}, google_cookies[0].get("expiry"))
with open("cookies.pkl","wb") as fd:
pickle.dump(cookies, fd)
return cookies
import requests
with requests.Session() as s:
with open("cookies.pkl","rb") as fd:
cookies, expiry = pickle.load(fd)
if expiry < time.time():
cookies, expiry = save_cookies()
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"Referer": "https://www.google.com/",
"Accept-Encoding": "deflate",
"Accept-Language": "en;q=0.6",
}
resp = s.get("https://myaccount.google.com/"
,headers=headers,cookies=cookies)
print(resp.url)
answered Dec 29 '18 at 8:21
kcorlidy
2,1702318
2,1702318
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53953343%2fusing-selenium-to-login-to-gmail-save-cookies-and-then-use-requests%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
So, what you want to do actually?
– Ratmir Asanov
Dec 28 '18 at 8:45
1
Why not use this? developers.google.com/gmail/api/quickstart/python
– kcorlidy
Dec 28 '18 at 8:48
@RatmirAsanov what I am trying to do is login to Gmail (using Selenium), save the cookies that are there when I am logged into Gmail, and then proceed to use those cookies in requests to search google,watch youtube etc. The point is to minimize the amount of Selenium possible.
– Joell
Dec 28 '18 at 17:47
@kcorlidy I can use that API, but from what I read in the description its basically like selenium in the sense that it creates a new browser session etc. I am much more familiar with selenium than Google's API hence my choice.
– Joell
Dec 28 '18 at 17:53