How to email using python selenium webdriver? [duplicate] - python

This question already has answers here:
Write and send Gmail with Selenium for Python
(4 answers)
Closed 1 year ago.
I was wondering if I was able to send an email with python, selenium, webdriver
Ie. I am looking for a product
Webpage refreshes and the product is there
I am emailed above said product that becomes available?
Any help is appreciated
I am using Chrome driver in pycharm with python and selenium
Is this possible?

Here is a solution using smtplib
https://www.knowledgehut.com/tutorials/python-tutorial/python-send-email

Related

Find Webpage Element Using Requests, Scrapy or Selenium [duplicate]

This question already has answers here:
Selenium webdriver: Modifying navigator.webdriver flag to prevent selenium detection
(15 answers)
Can a website detect when you are using Selenium with chromedriver?
(25 answers)
Is there a way to use Selenium WebDriver without informing the document that it is controlled by WebDriver?
(1 answer)
Closed 1 year ago.
I am trying to interact with a webpage that has strong bot detection measures. This means I cannot use things like Requests, Scrapy or Selenium as they get detected. Even Undetected Chromedriver doesn't work.
I just need to perform a few simple clicks on the site so am trying to implement something using Pyautogui.
However, I still need to find whether certain elements exist. Is there a way of doing this without using those libraries?

Alert handling in Selenium Python [duplicate]

This question already has answers here:
Python Windows Authentication username and password is not working
(2 answers)
Closed 2 years ago.
I'm trying to automate the login of my college website but the site is behaving kinda awkward nowadays. It is showing an alert for signing(which doesn't work though) and the link keeps on loading. When the alert is canceled then the site loads completely.
I'm using selenium and the next line to driver.get method only executes if the site is loaded completely.
the link is https://learn.upes.ac.in/
user this method to dismiss the popup prompt and continue with your (normal) method of login.
driver.switch_to_alert().dismiss()

login in gmail using seleniun in heroku [duplicate]

This question already has answers here:
Log into gmail using Selenium in Python
(2 answers)
Selenium Google Login Block
(12 answers)
Closed 2 years ago.
I am writing a python program to delete a number of email from same user and for it i am using selenium as an automation program and to host that program in heroku
The problem is when i login in gmail in my pc it is working just fine where as when i try it from selenium it gives me an error saying that it can't find email input field
note : to make selenium work on heroku i have use this method
here is my code
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
driver = webdriver.Chrome('chromedriver.exe')
driver.maximize_window()
driver.get('https://accounts.google.com/signin/v2/identifier?continue=https%3A%2F%2Fmail.google.com%2Fmail%2F&service=mail&sacu=1&rip=1&flowName=GlifWebSignIn&flowEntry=ServiceLogin')
driver.find_element_by_id('identifierId').send_keys('gpt.sahaj28#gmail.com') # here is when the error occur in heroku
driver.find_element_by_class_name('CwaK9').click()
at second last line error occur in heroku where as it works just fine in pc
i cant seem to figure out problem
So I highly don't suggest using selenium to delete a user's email, as it may be violated Gmail's Terms of Use and Privacy Policy. What I suggest more is using Gmail's API to manage user's emails. Hope that helps.

python selenium chrome sign in script button not clickable [duplicate]

This question already has answers here:
Log into gmail using Selenium in Python
(2 answers)
What is the xpath of gmail password field in firefox browser [closed]
(7 answers)
Closed 4 years ago.
Im making a chrome sign in script and the last part where the program should press the next button is not working.
import selenium
from selenium import webdriver
browser = webdriver.Chrome()
browser.get("https://accounts.google.com/signin/v2/identifier?hl=EN&flowName=GlifWebSignIn&flowEntry=ServiceLogin")
email = browser.find_element_by_id("identifierId")
email.send_keys("email")
browser.find_element_by_id("identifierNext").click()
browser.implicitly_wait(4)
password = browser.find_element_by_name("password")
password.send_keys("password")
browser.find_element_by_xpath('//*[#id="passwordNext"]/content/span').click()
I have tried using the name, ID and the xpath and none have worked
The error message says it is not clickable. Any help would be greatly appreciated I'm very new to programming.

Login to Gmail with Selenium Webdriver [duplicate]

This question already has answers here:
Log into gmail using Selenium in Python
(2 answers)
Closed 5 years ago.
I'm trying to automatically log into Gmail via a Python script. I'm using the selenium webdriver. I've managed to get my email entered but I don't know how to get my password entered as well. I've already checked past questions on here but the selectors mentioned in the answers don't seem to work. I keep getting an "Unable to locate element" error.
The code I tried:
driver.find_element_by_name("password").send_keys(pw)
You can use wait before if wanted otherwise you can achieve this simlply by ID
Gpassword = driver.find_element_by_id("password")
Gpassword.send_keys("xxxxxxxx")
This should be a comment but I don't have the 50 required rep.
I would try the GMail Python API. It should be a lot easier:
https://developers.google.com/gmail/api/quickstart/python
Make sure the element name is correct
make sure the element is visible (not overlapped by another element. ex: by virtual keyboard (in mobile application) or by auto-complete box)

Categories