Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding information about the Python WebDriver API

Specifically, I want to

  • Scroll up and down the page
  • Focus a given element
  • Deal with "Choose a file" dialog pages

I had a look here, in vain.

like image 773
Randomblue Avatar asked Feb 23 '26 14:02

Randomblue


1 Answers

for scroll up and scroll down can't you use PAGE_UP = u’ue00e’ PAGE_DOWN = u’ue00f’

for focus you should be ok with driver.execute_script('document.getElementById("myId").focus()')

for file chose it's just an input driver.execute_script(r'document.getElementById("myId").value="c:\\test\\myfile.txt"')

like image 146
Xavier Combelle Avatar answered Feb 25 '26 03:02

Xavier Combelle



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!