I have tried to handle the dynamic xpath and css selector by many ways, but not getting the correct solution. Please help me out regarding this issue.
xpath is //*[@id="product_properties_attributes_15434094021_value"]
Here the number "15434094021" is changing every time at the time of opening the page. I have also tried with css selector by it is not solved. I have tried with "Starts with" & "Contains", but not solved. Before the same type of questions are posted and answered also. But this question is not solved and that is why I have posted this question.
getting this error for starts-with
selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression //*div[starts-with(@id,'product_properties_attributes_')] because of the following error: SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//*div[starts-with(@id,'product_properties_attributes_')]' is not a valid XPath expression.
And this below-mentioned error for using "contains" -
selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression //*div[contains(@id,'product_properties_attributes_') and contains(@id,'_value')] because of the following error: SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//*div[contains(@id,'product_properties_attributes_') and contains(@id,'_value')]' is not a valid XPath expression.