From 5863bd70d404fc80f4c0351123594d374e0cd251 Mon Sep 17 00:00:00 2001 From: Waylon Walker Date: Fri, 24 Jul 2020 23:33:07 -0500 Subject: [PATCH] Update sample.py --- sample.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sample.py b/sample.py index 904c65a..d040b5b 100644 --- a/sample.py +++ b/sample.py @@ -4,9 +4,11 @@ if __name__ == "__main__": driver = webdriver.Chrome() driver.get("https://waylonwalker.com/") - - passed = driver.find_element_by_css_selector(".about").is_displayed() - + headers = driver.find_elements_by_tag_name("h2") + + passed = headers[0].is_displayed() + + print('number of headers: ', len(headers)) print("Test passed") if passed else print("Test failed") driver.quit()