• <small id='QjCZG'></small><noframes id='QjCZG'>

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

    <tfoot id='QjCZG'></tfoot>

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

          <bdo id='QjCZG'></bdo><ul id='QjCZG'></ul>
      1. 使用 Splinter 填写密码表单

        Filling a password form with Splinter(使用 Splinter 填写密码表单)

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

          1. <legend id='x3dw6'><style id='x3dw6'><dir id='x3dw6'><q id='x3dw6'></q></dir></style></legend>
            <tfoot id='x3dw6'></tfoot>
              • <i id='x3dw6'><tr id='x3dw6'><dt id='x3dw6'><q id='x3dw6'><span id='x3dw6'><b id='x3dw6'><form id='x3dw6'><ins id='x3dw6'></ins><ul id='x3dw6'></ul><sub id='x3dw6'></sub></form><legend id='x3dw6'></legend><bdo id='x3dw6'><pre id='x3dw6'><center id='x3dw6'></center></pre></bdo></b><th id='x3dw6'></th></span></q></dt></tr></i><div id='x3dw6'><tfoot id='x3dw6'></tfoot><dl id='x3dw6'><fieldset id='x3dw6'></fieldset></dl></div>
                • <bdo id='x3dw6'></bdo><ul id='x3dw6'></ul>
                    <tbody id='x3dw6'></tbody>
                  本文介绍了使用 Splinter 填写密码表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试填写两张表格并登录我的银行网站.

                  I'm trying to fill two forms and login to my banks website.

                  我可以获得要填写的用户名的第一个表格,但我似乎无法获得要填写的密码表格.

                  I can get the first form for the username to fill but I can't seem to get the form for the password to fill.

                  这是我正在使用的代码:

                  Here's the code I'm using:

                  from splinter import Browser
                  
                  username2 = '***'
                  password2 = '***'
                  
                  browser2 = Browser()
                  browser2.visit('http://mijn.ing.nl')
                  
                  browser2.find_by_css('.firstfield').fill(username2)
                  browser2.find_by_id('#easnhbcc').fill(password2)
                  

                  这是完整的追溯:

                  /usr/local/bin/python2 "/Users/narekaramjan/Dropbox/Python/Python 273/Test.py"
                  Traceback (most recent call last):
                    File "/Users/narekaramjan/Dropbox/Python/Python 273/Test.py", line 26, in <module>
                      browser2.find_by_id('#easnhbcc').fill(password2)
                    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/splinter/element_list.py", line 73, in __getattr__
                      self.__class__.__name__, name))
                  AttributeError: 'ElementList' object has no attribute 'fill'
                  
                  Process finished with exit code 1
                  

                  我也试过了:

                  browser2.find_by_name('easnhbcc').fill(password2)
                  

                  我怎样才能得到密码表来填写?

                  How can I get the password form to fil?

                  推荐答案

                  这里是工作代码:

                  from splinter import Browser     
                  
                  # Define the username and password
                  username2 = '***'
                  password2 = '***'
                  
                  # Choose the browser (default is Firefox)
                  browser2 = Browser()
                  
                  # Fill in the url
                  browser2.visit('https://mijn.ing.nl/internetbankieren/SesamLoginServlet')
                  
                  # Find the username form and fill it with the defined username
                  browser2.find_by_id('gebruikersnaam').first.find_by_tag('input').fill(username2)
                  
                  # Find the password form and fill it with the defined password
                  browser2.find_by_id('wachtwoord').first.find_by_tag('input').fill(password2)
                  
                  # Find the submit button and click
                  browser2.find_by_css('.submit').first.click()
                  
                  # Print the current url
                  print browser2.url
                  
                  # Print the current browser title
                  print browser2.title
                  
                  # Print the current html source code
                  print browser2.html
                  

                  这篇关于使用 Splinter 填写密码表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Adding config modes to Plotly.Py offline - modebar(将配置模式添加到 Plotly.Py 离线 - 模式栏)
                  Plotly: How to style a plotly figure so that it doesn#39;t display gaps for missing dates?(Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙?)
                  python save plotly plot to local file and insert into html(python将绘图保存到本地文件并插入到html中)
                  Plotly: What color cycle does plotly express follow?(情节:情节表达遵循什么颜色循环?)
                  How to save plotly express plot into a html or static image file?(如何将情节表达图保存到 html 或静态图像文件中?)
                  Plotly: How to make a line plot from a pandas dataframe with a long or wide format?(Plotly:如何使用长格式或宽格式的 pandas 数据框制作线图?)
                • <small id='ZFXDs'></small><noframes id='ZFXDs'>

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

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

                          1. <legend id='ZFXDs'><style id='ZFXDs'><dir id='ZFXDs'><q id='ZFXDs'></q></dir></style></legend>
                              <tbody id='ZFXDs'></tbody>