I can't locate element on website and insert numerical value inside using Selenium on Firefox with Python.
I am using firefox add-in to get the xPath for the input field, I receive:
/html/body/div1/section/div/div/div/div/form/div1/div/div[4]/div2/div/div/div/div1/div1/table/tbody/tr1/td3/div/input
however with Python code objDriver.find_element_by_xpath("...") - I receive "Unable to locate element:" -> like xpath is wrong
If I use it on the let's say border of the input field, I get following xPath:
/html/body/div1/section/div/div/div/div/form/div1/div/div[4]/div2/div/div/div/div1/div1/table/tbody/tr1/td3
This element I can allocate using objDriver.find_element_by_xpath("...") but it is not input field, so I can't insert value
- If I click "Inspect" in Firefox, I get:
CSS Path:
html body div.main-content section.section div.block-one_col_1 div.container-fluid.wrapper div.row div.col-12 form#id_form-process.form-horizontal.formfactory div.row div.col-md div#fieldgroup_variants.fieldset div#fieldgroup_variants__fields.fieldset__content div.form-group.row.formfield_variantsCalculator.fieldpk_2533.mb-0.is-valid div.col-md-6.col-12 div.d-flex.flex-row div.w-100 div.table-scroll table.table.table--step tbody#tableContent.table tr.table-row.table-row--count td div.form-group.group1 input.form-control.variant-value.variant1.touched
xPath:
/html/body/div/section/div/div/div/div/form/div[1]/div/div[4]/div[2]/div/div/div/div[1]/div[1]/table/tbody/tr[1]/td[3]/div/input
HTML part I am interested in:
<td data-risk="6.1"><div class="form-group group1" data-excluded="false" data-risk="6.1"><input name="1" class="form-control variant-value variant1 touched" data-editable="true" data-risk="6.1" data-visible-sum="true" data-dynamic="false"></div></td>
Do you have any idea how can I locate the field I need?
General view of Input field:
When getting xPath of the border:
When getting xPath of the Input field: