I'm trying to get the src of an element as a string.
I used find_element_by_xpath()
to find the element. I'm able to use element.get_attribute("class")
to get the class but unable to get the src
this way.
A snippet of my code:
image = driver.find_element_by_xpath('//*[@id="irc_cc"]/div[2]/div[1]/div[2]/div[1]/a/img')
print(image.get_attribute("class"))
print(image.get_attribute("src"))
Here is the result my terminal:
irc_mi
None
This is what the element in chrome inspect element looks like: