我是新來美麗的湯,我試圖提取出現在頁面上的信息。此信息包含在div class =「_ 50f3」中,根據用戶可以包含多個信息(研究,學習,作品,工作,生活等)。所以,到目前爲止,我已成功雖然下面的代碼來解析DIV類,但我不知道如何提取我從想要的信息..提取頁面介紹信息與美麗的湯
table = soup.findAll('div', {'class': '_50f3'})
[<div class="_50f3">Lives in <a class="profileLink" data-hovercard="/ajax/hovercard/page.php?id=114148045261892" href="/Fort-Worth-Texas/114148045261892?ref=br_rs">Fort Worth, Texas</a></div>,
<div class="_50f3">From <a class="profileLink" data-hovercard="/ajax/hovercard/page.php?id=111762725508574" href="/Dallas-Texas/111762725508574?ref=br_rs">Dallas, Texas</a></div>]
例如,在上面,我想存儲「生活在」:「德克薩斯州的沃斯堡」和「來自」:「德克薩斯州達拉斯」。但在最一般的情況下,我想存儲那裏的任何信息。
任何幫助非常感謝!