簡體   English   中英

Python:如何使用splinter / Browser一次填寫表單?

[英]Python: How to fill out form all at once with splinter/Browser?

目前,我正在使用以下內容在網站上填寫表格:

browser.fill(‘form[firstname]’, ‘Mabel’)
browser.fill(‘form[email]’, ‘hi@hi.com’)
browser.select(‘form[color]’, ‘yellow’)

但表格依次填寫表格,一個接一個。 有沒有辦法一次填寫表格?

謝謝你,一定會投票並接受答案!

瀏覽器有一個名為: fill_form(field_values)

它需要一個dict參數,字段名稱和值,它會立即填充表單。

所以你將使用browser.fill_form(dict)而不是browser.fill(field, value)

有關Browser的API及其方法的更多信息:

https://splinter.readthedocs.io/en/latest/api/driver-and-element-api.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM