<bdo id='6W60J'></bdo><ul id='6W60J'></ul>

    1. <small id='6W60J'></small><noframes id='6W60J'>

        <legend id='6W60J'><style id='6W60J'><dir id='6W60J'><q id='6W60J'></q></dir></style></legend>

      1. <tfoot id='6W60J'></tfoot>
        <i id='6W60J'><tr id='6W60J'><dt id='6W60J'><q id='6W60J'><span id='6W60J'><b id='6W60J'><form id='6W60J'><ins id='6W60J'></ins><ul id='6W60J'></ul><sub id='6W60J'></sub></form><legend id='6W60J'></legend><bdo id='6W60J'><pre id='6W60J'><center id='6W60J'></center></pre></bdo></b><th id='6W60J'></th></span></q></dt></tr></i><div id='6W60J'><tfoot id='6W60J'></tfoot><dl id='6W60J'><fieldset id='6W60J'></fieldset></dl></div>

        Python/Selenium - 无法单击 www.instagram.com 上的“接受

        时间:2023-10-08
              <tfoot id='HuQso'></tfoot>
              <legend id='HuQso'><style id='HuQso'><dir id='HuQso'><q id='HuQso'></q></dir></style></legend>

                <tbody id='HuQso'></tbody>

                <small id='HuQso'></small><noframes id='HuQso'>

                  <bdo id='HuQso'></bdo><ul id='HuQso'></ul>
                • <i id='HuQso'><tr id='HuQso'><dt id='HuQso'><q id='HuQso'><span id='HuQso'><b id='HuQso'><form id='HuQso'><ins id='HuQso'></ins><ul id='HuQso'></ul><sub id='HuQso'></sub></form><legend id='HuQso'></legend><bdo id='HuQso'><pre id='HuQso'><center id='HuQso'></center></pre></bdo></b><th id='HuQso'></th></span></q></dt></tr></i><div id='HuQso'><tfoot id='HuQso'></tfoot><dl id='HuQso'><fieldset id='HuQso'></fieldset></dl></div>
                  本文介绍了Python/Selenium - 无法单击 www.instagram.com 上的“接受 cookie"按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在尝试使用 python selenium 登录 instagram.但我必须接受 cookie 才能继续.

                  Im trying to login on instagram using python selenium. But i have to Accept the cookies in order to continue.

                  这是我的代码

                  class InstaBot:
                      def __init__(self, username, pw):
                          self.driver = webdriver.Chrome()
                          self.driver.get('https://www.instagram.com/')
                          sleep(2)
                   #this is the code that im trying to use, so to click the accept button 
                  self.driver.find_element_by_xpath("/html/body/div[2]/div/div/div/div[2]/button[1]").click() 
                          self.driver.find_element_by_xpath("//input[@name="username"]")
                              .send_keys(username)
                          self.driver.find_element_by_xpath("//input[@name="password"]")
                              .send_keys(pw)
                          self.driver.find_element_by_xpath("//a[contains(text(), 'Log in')]")
                              .click()
                          sleep(4)
                  

                  问题是当它点击接受按钮时它什么也不做.有什么想法吗?

                  The problem is that when it gets to click the accept button it does nothing. Any ideas?

                  推荐答案

                  试试这个:

                  self.driver.find_element_by_xpath("//button[text()='Accept']").click()
                  

                  我在这里发布了我的解决方案:在 www.instagram.com 上使用 Python/Selenium 接受 cookie 错误

                  I posted my solution here: Accepting cookies error with Python/Selenium on www.instagram.com

                  这篇关于Python/Selenium - 无法单击 www.instagram.com 上的“接受 cookie"按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:ChromeDriver ERR_SSL_PROTOCOL_ERROR 尽管 --ignore-certifica 下一篇:WebDriverException:消息:服务/usr/bin/google-chrome 意外退

                  相关文章

                  最新文章

                    <legend id='TkdAx'><style id='TkdAx'><dir id='TkdAx'><q id='TkdAx'></q></dir></style></legend>

                    <small id='TkdAx'></small><noframes id='TkdAx'>

                    <i id='TkdAx'><tr id='TkdAx'><dt id='TkdAx'><q id='TkdAx'><span id='TkdAx'><b id='TkdAx'><form id='TkdAx'><ins id='TkdAx'></ins><ul id='TkdAx'></ul><sub id='TkdAx'></sub></form><legend id='TkdAx'></legend><bdo id='TkdAx'><pre id='TkdAx'><center id='TkdAx'></center></pre></bdo></b><th id='TkdAx'></th></span></q></dt></tr></i><div id='TkdAx'><tfoot id='TkdAx'></tfoot><dl id='TkdAx'><fieldset id='TkdAx'></fieldset></dl></div>

                      <tfoot id='TkdAx'></tfoot>
                        <bdo id='TkdAx'></bdo><ul id='TkdAx'></ul>