-
Hello, trying out SeleniumBase & web scraping in general for the first time. I'm using uc mode & have 2 questions about SeleniumBase
Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Answer to question 1:
For example, here's a script that prints out the tag name of all the elements on a page: from seleniumbase import SB
with SB(uc=True) as sb:
sb.open("https://seleniumbase.io/demo_page")
elements = sb.find_elements("*")
print(len(elements))
for element in elements:
print(element.tag_name) Answer to question 2:The chrome://extensions/ page has a lot of Shadow DOM. You'll need to pierce through that to perform actions. Here are some examples that use Shadow DOM: (These use the |
Beta Was this translation helpful? Give feedback.
Answer to question 1:
elements = sb.find_elements("*")
For example, here's a script that prints out the tag name of all the elements on a page:
Answer to question 2:
The chrome://extensions/ page has a lot of Shadow DOM. You'll need to pierce through that to perform actions. Here are some examples that use Shadow DOM: (These use the
BaseCase
format. See Syntax Formats.)