Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97762

get text from element with on its composition, using Python Selenium

$
0
0

I'm pulling contact information (text) from a website and I can currently pull all the class data, using the following xpath syntax:

//*[@id="nomapdata"]/div/div/div/div[2]/div[1]

Using this xpath for the element, I get the following text as result:

Name
Title
Company Website
Phone Number

What I want to do, is to pull each of these elements individually, but the problem is that, the data is separated by <br> </br>, and I haven't had success on isolating each element.

Below is an example of the HTML structure:

<div class="col-sm-d">
"
                  Name"<br>
"
                              Title"<br>
a href="www.website.com" target="_blank">http://www.website.com</a>
<br>
"

Phone: (555) 555-5555"<br>

The only element I am able to isolate is the website.

How can I isolate each data on this scenario?


Viewing all articles
Browse latest Browse all 97762

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>