0

I am trying to fill in an input field on a webpage using this code:

from splinter import Browser
from bs4 import BeautifulSoup as bs
from webdriver_manager.chrome import ChromeDriverManager
from selenium import webdriver

executable_path = {'executable_path':ChromeDriverManager().install()}
browser = Browser('chrome', **executable_path, headless = False)
browser.visit('http://webapps2.rrc.state.tx.us/EWA/wellboreQueryAction.do')
**browser.find_by_name('searchArgs.leaseNumberArg').fill('searchArgs.leaseNumberArg',
                                                    '160895')**

I get this error: TypeError: fill() takes 2 positional arguments but 3 were given

I've used the same syntax to successfully fill other input fields. As far as I can tell the only difference here is that the input field name contains a '.' which I think possibly relates to a column of some kind of data structure.

Any thought on how to get past this road block?

1 Answers1

0

I've never used splinter before so I'm not sure myself. But after reading your code how about writing your code like this ?

browser.find_by_name('searchArgs.leaseNumberArg').fill('160895')

If I'm not wrong, you already have the element by using find_by_name() so you don't need to pass it second time inside the fill methods. Seems logic.

Here is another post that show how to use fill().