使用此代码,我收到此错误“ 65没有通往主机的路由”:
import requests
from bs4 import BeautifulSoup as soup
def get_emails(_links:list):
for i in range(len(_links)):
new_d = soup(requests.get(_links[i]).text, 'html.parser').find_all('a', {'class':'my_modal_open'})
if new_d:
yield new_d[-1]['title']
start = 0
count=0
while True:
d = soup(requests.get('http://www.schulliste.eu/type/gymnasien/?bundesland=&start={page_id}'.format(page_id=start)).text, 'html.parser')
results = [i['href'] for i in d.find_all('a')][52:-9]
results = [link for link in results if link.startswith('http://')]
items = list(set(get_emails(results)))
for item in items:
count=+1
print(item, end = ",")
#print(list(get_emails(results)))
next_page=d.find('div', {'class': 'paging'},'weiter')
if next_page:
start+=20
if start == 2440:
print ("Fertig")
else:
break
print("Break")
print(count)
有人知道我为什么会收到此错误的线索吗?我想从网站上删除电子邮件地址。