Skip to content

Commit

Permalink
added feature #1539 to each translation (#1873)
Browse files Browse the repository at this point in the history
added feature 1539 to each translation

Co-authored-by: Diego Molina <[email protected]>

[deploy site]
  • Loading branch information
shbenzer committed Aug 19, 2024
1 parent bb2cd99 commit 8a57ce0
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,24 @@ from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.get("https://www.example.com")
##get elements from parent element using TAG_NAME

# Get element with tag name 'div'
element = driver.find_element(By.TAG_NAME, 'div')

# Get all the elements available with tag name 'p'
# NOTE: in order to utilize XPATH from current element, you must add "." to beginning of path
elements = element.find_elements(By.TAG_NAME, 'p')
for e in elements:
print(e.text)

##get elements from parent element using XPATH

# Get first element of tag 'ul'
element = driver.find_element(By.XPATH, '//ul')

# get children of tag 'ul' with tag 'li'
elements = driver.find_elements(By.XPATH, './/li')
for e in elements:
print(e.text)
{{< /tab >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,24 @@ from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.get("https://www.example.com")
##get elements from parent element using TAG_NAME

# Get element with tag name 'div'
element = driver.find_element(By.TAG_NAME, 'div')

# Get all the elements available with tag name 'p'
# NOTE: in order to utilize XPATH from current element, you must add "." to beginning of path
elements = element.find_elements(By.TAG_NAME, 'p')
for e in elements:
print(e.text)

##get elements from parent element using XPATH

# Get first element of tag 'ul'
element = driver.find_element(By.XPATH, '//ul')

# get children of tag 'ul' with tag 'li'
elements = driver.find_elements(By.XPATH, './/li')
for e in elements:
print(e.text)
{{< /tab >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,17 +293,24 @@ Para realizar isso, o WebElement pai é encadeado com o 'findElements' para aces
}
{{< /tab >}}
{{< tab header="Python" >}}
from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.get("https://www.example.com")
##get elements from parent element using TAG_NAME

# Obtém o elemento com o nome da tag 'div'
element = driver.find_element(By.TAG_NAME, 'div')

# Obtém todos os elementos disponíveis com o nome da tag 'p'
# NOTE: in order to utilize XPATH from current element, you must add "." to beginning of path
elements = element.find_elements(By.TAG_NAME, 'p')
for e in elements:
print(e.text)

##get elements from parent element using XPATH

# Get first element of tag 'ul'
element = driver.find_element(By.XPATH, '//ul')

# get children of tag 'ul' with tag 'li'
elements = driver.find_elements(By.XPATH, './/li')
for e in elements:
print(e.text)
{{< /tab >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,24 @@ from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.get("https://www.example.com")
##get elements from parent element using TAG_NAME

# Get element with tag name 'div'
element = driver.find_element(By.TAG_NAME, 'div')

# Get all the elements available with tag name 'p'
# NOTE: in order to utilize XPATH from current element, you must add "." to beginning of path
elements = element.find_elements(By.TAG_NAME, 'p')
for e in elements:
print(e.text)

##get elements from parent element using XPATH

# Get first element of tag 'ul'
element = driver.find_element(By.XPATH, '//ul')

# get children of tag 'ul' with tag 'li'
elements = driver.find_elements(By.XPATH, './/li')
for e in elements:
print(e.text)
{{< /tab >}}
Expand Down

0 comments on commit 8a57ce0

Please sign in to comment.