def check_domain_reputation(domain):
url = fhttps://www.google.com/search?q={domain}
response = requests.get(url)
if No results found、in response.text:
return False
else:
return True
domains = [example.com, anotherexample.com]
for domain in domains:
if check_domain_reputation(domain):
print(f{domain} is indexed.)
else:
print(f{domain} is not indexed.)
4、使用API
有些搜索引擎提供了API接口,可以直接调用这些接口来查询域名的收录情况。例如:
Google Search Console API: 虽然主要用于验证站点所有权和管理索引设置,但也可以用来查询特定域名的收录情况。
Bing Webmaster Tools API: 提供了一些功能来帮助你管理你的网站在Bing搜索引擎中的表现。