I wrote a code to scrape all h4
elements from a homepage.
// Wikipedia is only an example.
browser.get("https://en.wikipedia.org/wiki/Main_Page")
time.sleep(5)
datei = open("bayern.csv", "a")
elems = browser.find_elements_by_css_selector("h4.name")
for elem in elems:
print(elem)
In my command line I get this output:
<selenium.webdriver.remote.webelement.WebElement (session="f1ef1ee5904aa8b3279e6bf9adb62d34", element="0.09001580038742651-1") >
But I want the content of all h4
elements. Can you tell me why I get this strange output?
h4.name
would match all h4 elements?