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()
Related
This question already has an answer here:
Unable to use Selenium to automate Chase site login
(1 answer)
Closed 1 year ago.
Here is what I tried :
from selenium import webdriver
driver = webdriver.Chrome(executable_path='chromedriver.exe')
driver.get("https://secure07c.chase.com/web/auth/#/logon/logon/chaseOnline?")
username = driver.find_element_by_id("userId-text-input-field")
The problem I ran into is that when I simply execute this and then manually fill the fields and click login, an error page that is made for protecting from bots pops up.
When I remove the line username = driver.find_element_by_id("userId-text-input-field") the website works correctly and I can login manually from the automated selenium webdriver driven page.
Same problem happens when doing driver.page_source and many other tests that request elements from the webpage.
I tried a lot of things (most options, flags, user agent, ...) but they are not relevant in this issue that's why I included the simplified version of the code that is causing the issue, basically any element selection.
The way selenium requests elements is suspicious I guess, simply finding elements raised suspicion in the chase bank website. I want to understand how selenium is finding / selecting elements and how anti-bots are detecting this very simple action. Is there a way around it ?
Chase can see that it is an automated script sending the request, not a real human sending it. Stack Overflow also uses similar technology. There is no way to escape this, otherwise, bots would be all over banking websites and DDoSing them.
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
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.
This question already has answers here:
Can a website detect when you are using Selenium with chromedriver?
(25 answers)
Closed 4 years ago.
What options do I set for chromedriver so that the web server cannot tells the browser is manually launched or programming launched using Selenium?
Thanks,
The Webserver you try to access has no way of knowing how the browser has been launched. It can only detect (or rather, guess) that it's an automated browser when said browser shows atypical behavior for a human (e.g. makes loads of requests per seconds, clicks 2 things with no delay whatsoever). Therefor it doesn't matter how you launch the browser - just how you use it.
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)