Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/322.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Can';在登录时,无法摆脱站点抛出的特定障碍_Python_Python 3.x_Selenium_Selenium Webdriver_Web Scraping - Fatal编程技术网

Python Can';在登录时,无法摆脱站点抛出的特定障碍

Python Can';在登录时,无法摆脱站点抛出的特定障碍,python,python-3.x,selenium,selenium-webdriver,web-scraping,Python,Python 3.x,Selenium,Selenium Webdriver,Web Scraping,我试图使用selenium登录到一个站点,但我遇到了一个问题。当脚本应该输入密码时,输入用户名后,将显示该页面。当我在chrome浏览器中手动执行相同操作时,我获得了成功 我试过: from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.su

我试图使用selenium登录到一个站点,但我遇到了一个问题。当脚本应该输入密码时,输入用户名后,将显示该页面。当我在chrome浏览器中手动执行相同操作时,我获得了成功

我试过:

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

link = 'https://merchants.google.com/mc/default?hl=en&fmp=1&utm_id=gfr&mcsubid=us-en-z-g-mc-gfr'

username = "your_gmail_id"
password = "your_password"

driver = webdriver.Chrome()
wait = WebDriverWait(driver, 10)
driver.get(link)
wait.until(EC.presence_of_element_located((By.CSS_SELECTOR,"input#identifierId"))).send_keys(username)
wait.until(EC.presence_of_element_located((By.CSS_SELECTOR,"#identifierNext"))).click()
wait.until(EC.presence_of_element_located((By.CSS_SELECTOR,"input[aria-label='Enter your password']"))).send_keys(password)
我怎样才能摆脱这个障碍


请尝试在您的google帐户安全配置中激活“不太安全的应用程序访问”。另外,确保您没有进行两步验证


我已激活了
不太安全的应用程序访问
选项,并在上禁用了
两步验证,但仍具有运行脚本时在图像中显示的相同页面。您使用的Chrome版本是什么@robots.txt这一个
版本83.0.4103.116(官方版本)(32位)
。看到这篇文章被关闭,我真的很惊讶。请尝试以下操作:1)卸载并重新安装google chrome,看看这是否解决了问题2)创建一个没有配置的假google帐户,并尝试使用这个新帐户登录3)看这段视频它帮助其他人解决了@robots的问题。txtI遵循所有可能的步骤。然而,我在帖子中尝试的链接仍然显示该页面。我在这里得到的解决方案和上面链接中的解决方案无法解决问题。这篇文章怎么会重复?我终于解决了这个问题。我可以在这里粘贴一个有效的解决方案,但问题是帖子被锁定了。