Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

extract text from span python

import re
from bs4 import BeautifulSoup

soup = BeautifulSoup("""<div class="systemRequirementsMainBox">
   <div class="systemRequirementsRamContent">
      <span title="000 Plus Minimum RAM Requirement">1 GB</span>
   </div>""", "xml")

print(soup.find("span", title = re.compile("RAM")).text)
 
PREVIOUS NEXT
Tagged: #extract #text #span #python
ADD COMMENT
Topic
Name
2+1 =