Python 朋友们好,我想分开几封电子邮件,看看哪些已经创建,哪些还没有创建
见此:Python 朋友们好,我想分开几封电子邮件,看看哪些已经创建,哪些还没有创建,python,python-3.x,beautifulsoup,request,Python,Python 3.x,Beautifulsoup,Request,见此: import requests from bs4 import BeautifulSoup list1 = [] for i in range(0, 1000): user = "haji1" + str(i) + "7" if len(user) == 7: user = user[:5] + "00" + user[5:] elif len(user) == 8: u
import requests
from bs4 import BeautifulSoup
list1 = []
for i in range(0, 1000):
user = "haji1" + str(i) + "7"
if len(user) == 7:
user = user[:5] + "00" + user[5:]
elif len(user) == 8:
user = user[:5] + "0" + user[5:]
list1.append(user + "@gmail.come")
req = requests.get(
"https://accounts.google.com/signin/v2/identifier?hl\
=en&continue=https%\3A%\2F%\2Fmail.google.com%\2Fmail&servi\
ce=mail&flowName=GlifWebSignIn&flowEntry=AddSession"
)
soup = BeautifulSoup(req, "html.parser")
print(soup)
回溯(最近一次呼叫最后一次):
文件“c:/Users/MR/Desktop/tekra1.py”,第14行,在
soup=BeautifulSoup(req,'html.parser')
文件“C:\Users\MR\AppData\Local\Programs\Python\Python38-32\lib\site packages\bs4\\ uuu init\uu.py”,第287行,在\uu init中__
elif len(markup)我不确定您的代码最终应该做什么(请记住,自动请求是阻止您访问Google的可靠方法),但您只是缺少对响应文本的访问:
resp = requests.get("https://accounts.google.com/signin/v2/identifier...")
resp.raise_for_status() # raise an exception if there was an error
soup = BeautifulSoup(resp.text, "html.parser") # see "resp.text"
print(soup)
谢谢你,我的朋友。我有一封电子邮件,我只知道它的一些字符我想看看那封电子邮件是什么我的信息:gmail:haji1****7@gmail.com
resp = requests.get("https://accounts.google.com/signin/v2/identifier...")
resp.raise_for_status() # raise an exception if there was an error
soup = BeautifulSoup(resp.text, "html.parser") # see "resp.text"
print(soup)