-2
browser = webdriver.Chrome()
browser.browser.find_elements_by_xpath("//div[@class='a image']/img")

the html look like this

<div class="a image"><imgsrc="https://cloudfront.net/"></div>

how to get the src text ?

3

2 Answers 2

0

Try the following:

element = browser.browser.find_elements_by_xpath("//div[@class='a image']/img")
src = element.get_attribute("src")
Sign up to request clarification or add additional context in comments.

Comments

0
print(browser.find_element_by_tag_name("img").get_attribute('src'))

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.