Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/339.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 使用Splinter在表单中输入字符串_Python_Python 3.x_Splinter - Fatal编程技术网

Python 使用Splinter在表单中输入字符串

Python 使用Splinter在表单中输入字符串,python,python-3.x,splinter,Python,Python 3.x,Splinter,我试图在Amazon页面的表单中输入字符串。我做错了什么 from splinter import Browser import time url = 'https://sellercentral.amazon.com/fba/profitabilitycalculator/index?lang=en_US' executable_path = {'executable_path': 'chromedriver.exe'} browser = Browser('chrome', **exec

我试图在Amazon页面的表单中输入字符串。我做错了什么

from splinter import Browser
import time

url = 'https://sellercentral.amazon.com/fba/profitabilitycalculator/index?lang=en_US'

executable_path = {'executable_path': 'chromedriver.exe'}
browser = Browser('chrome', **executable_path, headless=False)

browser.visit(url)
time.sleep(2)
browser.find_by_id('search-form').first.type('Steve Jobs')
time.sleep(5)
browser.quit()

更新:

我可以通过以下方式单击表单:

browser.find_by_xpath(".//form//input[@type='text']").first.click()
但是,我无法填写表格