Skip to content
Advertisement

How can I slide input[type=text] using selenium in python?

enter image description here

I am scraping from a dynamic website and I need to slide this input to certain range. The HTML for this shows that it’s an input[type=’text] with display:none in disguise. After sliding, the text box is set to “{minValue}{maxValue}” based on the sliders’ positions.

JavaScript

I can’t set its values anyhow. I have tried:

  • changing the display to block and then editing the textbox to the required values.
  • changing the aria-valuenow attribute by executing js
  • changing the value attributes for the textbox.
JavaScript
JavaScript

It seems that the apply button that is clicked after sliding to the desired locations derives the min and max from the slider positions instead of any attributes. How do I handle sliding this then?

Advertisement

Answer

I solved the issue using:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement