Issue
I'm trying to get the text "(0 26 02) 1 68 23" of this element:
<div class="unmasked">
(0 26 02) 1 68 23
<br>
</div>
result.select(".unmasked")[0].text
gives me the right element, but the .text is empty.
Is there a way to get the value?
Solution
It's working fine.
from bs4 import BeautifulSoup
html_doc="""
<div class="unmasked">
(0 26 02) 1 68 23
<br>
</div>
"""
soup = BeautifulSoup(html_doc, 'html.parser')
t = soup.select(".unmasked")[0].text
print(t)
output:
(0 26 02) 1 68 23
Answered By - F.Hoque
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.