Пытаюсь сделать что то типа авторегера на python,
import requests
from bs4 import BeautifulSoup
# Get the email address from temp-mail.io
url = '
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')
email = soup.find('input', {'type': 'text', 'id': 'mail'}).get('value>
# Follow the link and enter the email address
url2 = '
response2 = requests.get(url2)
soup2 = BeautifulSoup(response2.text, 'html.parser')
form = soup2.find('form')
data = {
'email': email
}
response3 = requests.post(url2, data=data)
# Open the last email and click confirm sign-in
url3 = '
response4 = requests.get(url3)
soup3 = BeautifulSoup(response4.text, 'html.parser')
last_email = soup3.find('div', {'class': 'mail-list-item'})
confirm_url = last_email.find('a').get('href')
response5 = requests.get(confirm_url)
# Delete the email
url4 = '
response6 = requests.get(url4)
s
Выдает ошибку AttributeError: 'NoneType' object has no attribute 'get', как решить?
import requests
from bs4 import BeautifulSoup
# Get the email address from temp-mail.io
url = '
Ссылка скрыта от гостей
'response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')
email = soup.find('input', {'type': 'text', 'id': 'mail'}).get('value>
# Follow the link and enter the email address
url2 = '
Ссылка скрыта от гостей
'response2 = requests.get(url2)
soup2 = BeautifulSoup(response2.text, 'html.parser')
form = soup2.find('form')
data = {
'email': email
}
response3 = requests.post(url2, data=data)
# Open the last email and click confirm sign-in
url3 = '
Ссылка скрыта от гостей
'response4 = requests.get(url3)
soup3 = BeautifulSoup(response4.text, 'html.parser')
last_email = soup3.find('div', {'class': 'mail-list-item'})
confirm_url = last_email.find('a').get('href')
response5 = requests.get(confirm_url)
# Delete the email
url4 = '
Ссылка скрыта от гостей
'response6 = requests.get(url4)
s
Выдает ошибку AttributeError: 'NoneType' object has no attribute 'get', как решить?