HTML代码:
<div id="descProdotto"> <img alt="Mont Blanc Eyewear" class="logoDesc" src="http://151.9.39.27/nfs/Immagini/Loghi_Linee/BA.png"/> <p><span>Nome:</span> BA0055</p> <p><span>Occh.:</span> Metallo</p> <p><span>Forma:</span> Geometrico</p> <p><span>Tipo:</span> Cerchiato</p> <p><span>Asta Flex:</span> No</p> <p><span>Fitting:</span> Caucasian</p> <img class="separatore" height="11" src="../../Grafica/Icone/separator_S.png" width="197"/>
<div class="glassDes">
<p class="scroll"></p>
</div>
Python代码:
from bs4 import BeautifulSoup
def get_description(sorgente):
soup = BeautifulSoup(sorgente, 'html.parser')
list = soup.find_all("p")
for a in list:
print(a.find('Nome:')
code = driver.page_source
get_description(code)
我无法在变量中提取值:Nome
:BA0055
我该怎么做?
谢谢