简体   繁体   English

朋友你好,我想分开几封邮件看看哪些已经创建,哪些还没有创建

[英]Hello friends, I want to separate a few emails to see which ones have been created and which ones have not been created yet

see this:看到这个:

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)
Traceback (most recent call last):
  File "c:/Users/MR/Desktop/tekrar1.py", line 14, in <module>
    soup=BeautifulSoup(req,'html.parser')
  File "C:\Users\MR\AppData\Local\Programs\Python\Python38-32\lib\site-packages\bs4\__init__.py", line 287, in __init__
    elif len(markup) <= 256 and (
TypeError: object of type 'Response' has no len()

I'm not sure what your code should do in the end (and remember that automated requests are a surefire way to get yourself blocked from Google), but you're simply missing the access to the response's text:我不确定您的代码最终应该做什么(请记住,自动请求是让您被 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)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何查看日志记录模块创建了哪些python记录器? - How do I see which python loggers have been created by the logging module? 我如何从方法列表中得知哪些方法已在该类中定义,哪些已被继承? - How do i tell from a list of methods, which ones have been defined in that class and those that have been inherited? ValueError:model 顺序的权重尚未创建 - ValueError : Weights for model sequential have not yet been created 我有一个从另一个列表创建的列表。 但是,我不希望两个名字彼此重复。 我怎样才能做到这一点? - I have a list which has been created from another list. However, I do not want two names repeating after each other. How can I do that? 我有一组坐标,我需要知道哪些是线性的 - I have a set of coordinates and I need to know which ones are linear 为什么在尚未创建实例的情况下需要在__init__构造函数中指定self? - Why do we need to specify self in __init__ constructor while the instance have not been created yet? 金字塔烧杯访问已创建的会话 - Pyramid beaker accessing Sessions that have been created 正则表达式检查找到了哪些组 - Regex check which groups have been found 功能选择:尝试查看保留了哪些列时出现 AttributeError - Feature Selection: AttributeError when trying to see which columns have been retained 如果已经解析了标签并与python中的新标签合并,则可以跳过标签? - It's possible to skip tags if they have been already parsed and coninue with the newer ones in python?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM