from bs4 import BeautifulSoup
import requests as req
import os
resp = req.get("example.com")
soup = BeautifulSoup(resp.text, 'lxml')
i=soup.select_one("#id")
print(i.text)
from bs4 import BeautifulSoup
import requests as req
import re #добавил модуль re
resp = req.get("example.com")
soup = BeautifulSoup(resp.text, 'lxml')
i=soup.select_one("#id")
#вот и само решение на мой вопрос
a =(i.text)
result = re.findall(r'Дата последней активности: \d{2}.\d{2}.\d{4} \d{2}:\d{2}', a)
print (result)