2020年4月18日土曜日

Selenium find element by class FOR MULTIPLE CLASSES

When an element of web page has multiple classes, just set one class capture the element.

Like:
   
Use find element by class name

content = driver.find_element_by_class_name('content')

https://selenium-python.readthedocs.io/locating-elements.html


In above case, if class name "btn-red" is unique for the page,

content = driver.find_element_by_class_name('btn-red')

work.

0 件のコメント:

コメントを投稿