E
E
Eugene2020-02-10 01:07:57
Python
Eugene, 2020-02-10 01:07:57

Why doesn't scrolling with keys work in Selenium?

The task is this: on the site, when you click on a button, a window pops up where there is scrolling. I also need to insert scrolling into the loop (Because the block itself is infinite), so I decided to use scrolling with the END or PAGE_DOWN keys

block = browser.find_element_by_class_name('isgrP') #Найти блок, где нужно прокручиать
block.click() #Клик по блоку
block.send_keys(Keys_END) #Прокрутить на 1 шаг


Gives an error message
File "c:/Users/Eugene/Documents/Python/Tests/Inst/instparse.py", line 28, in
block.send_keys(Keys_PAGE_DOWN)
NameError: name 'Keys_PAGE_DOWN' is not defined


Tested without any clicks on blocks, and in other scripts
browser.find_element_by_tag_name('body').send_keys(Keys_END)

Also doesn't work

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sergey, 2020-02-10
@evgentor

Eugene , probably because in python a ENDclass constant Keysis denotedKeys.END

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question