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:
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)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.