Topto Topto - 6 months ago 48
Python Question

Can' locate a certain element using xpath locator in python

I've written an

to get to a certain element but unfortunately it is not being able to.

I can't understand where i'm getting deviated. Hope somebody will provide me with a little help.

I'm trying to locate the address from the below elements.

Here are the elements:

<div class="detail-contact-address">
<i class="fa fa-map-o"></i>
Address:36 Sukhumvit, Soi 15, Wattana, Klongtoey-nua, Bangkok 10110, Thailand

I was trying with:


Answer Source

User below xpath to get the text :


OR based on some string match


So you will get the text like

print driver.find_element_by_xpath("//div[@class='detail-contact-address']").text
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download