How to use the Python getpass.getpass in PyCharm

前端 未结 6 1122
醉话见心
醉话见心 2020-12-08 14:17

I have found getpass does not work in PyCharm. It just hangs.

In fact is seems msvcrt.getch and raw_input also don\'t work, so perhaps the issue is not with getpass

6条回答
  •  [愿得一人]
    2020-12-08 14:57

    At first use, my code in pycharm and then click the "Run" then click the "Edit Configurations" then select the 'Emulate terminal in output console'

    from selenium import webdriver
    from getpass import getpass
    email=input("Enter the email:")
    password= getpass("Enter the password:")
    driver=webdriver.Chrome()
    url='https://www.facebook.com/'
    driver.get(url)
    user_id=driver.find_element_by_id("email")
    user_id.send_keys(email)
    user_password=driver.find_element_by_id("pass")
    user_password.send_keys(password)
    login_button = 
    driver.find_element_by_id("u_0_b").click()
    time.sleep(30)
    

提交回复
热议问题