I want to scrape the salary of the job but there are many elements that don't relate to salary have the same tag name and class names how can I scrape it with beautifulsoup4 or I must find another web scraping libraries like selenium. And I think that the xpath will be the same also. How can I scrape the salary only without the another elements about the skills and description
html = '''
<div class="the-same-div">
<span class="header-span">Salary</span>
<span class="key-span">
<span class="css-8888">1000 Dollar</span>
</span>
</div>
<div class="the-same-div">
<span class="header-span">Skills</span>
<span class="key-span">
<span class="css-8888">Web scraping</span>
</span>
</div>
<div class="the-same-div">
<span class="header-span">Description</span>
<span class="key-span">
<span class="css-8888">This is a web scraping Job with good salary</span>
</span>
</div>'''
Now this is the python code to scrape the salary element
from bs4 import BeautifulSoup
soup = BeautifulSoup(html, "lxml")
salary = soup.find_all("span", {"class": "css-8888"})
Now how can I scrape the salary of this job. Thank you.