79147317

Date: 2024-11-01 08:13:41
Score: 0.5
Natty:
Report link
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium import webdriver

driver = webdriver.Chrome()
driver.maximize_window()

driver.get(<url_here> or  <path_to_your_html_file_here>)

PROPOSAL_LOCATOR = (
    By.XPATH, "//div[@class='infocontent']/div/div[2]/div/h3[1]")

h3_element = WebDriverWait(driver, 10, 2).until(
    EC.presence_of_element_located(PROPOSAL_LOCATOR)
)

h3_element_label = h3_element.text

print(h3_element_label)

driver.quit()

sources: [
[Selenium WebDriver page][1],
[Selenium-python API docs][1]
]

[![Implementation and desired output following original question][1]][1]

enter image description here

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Nathaniel Cobbinah