G
G
Goodron2018-04-05 18:21:34
Python
Goodron, 2018-04-05 18:21:34

How to parse mail using BeautifulSoup in Python 3.6?

Hello.
I need to pull mail from https://temp-mail.org.
This is how the code of the element containing the mail looks like:
5ac63eca41f3e450866589.png
I wrote a small codec:

import requests
from bs4 import BeautifulSoup

url = 'https://temp-mail.org'
page = requests.get(url).text

soup = BeautifulSoup(page)
mail = soup.find('div', {'class': 'yourmail'})
print(mail)

What it outputs:
5ac63f8888ad0858115319.png
Please tell me how to filter the result so that only the "value" value is displayed, that is, only the mail itself?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question