Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to get the "title" from the <span>

How can I get the title "Product Manager" from the code below?

<div class="new_job_name" data-v-99ef4628="">
    <span data-v-99ef4628="">Product Manager</span>
</div>

If the title was in the <div class= "new_job_name">, I can get it using the code below:

soup.find(class_="new_job_name").attrs["title"]

Now I have no idea how to get the "title" within the <span> under the <div class>.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can just find the span inside the div with class new_job_name

soup.find(class_="new_job_name").find('span').text

Note: I have framed this answer based on your HTML, if there are multiple div with class new_job_name then you need to loop through the array

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading