python - 不安全的浏览

标签 python internet-explorer google-chrome firefox selenium

当尝试访问某些包含恶意内容的网站时,Firefox、Google Chrome 或 Internet Explorer 等浏览器会显示一条类似以下消息,表示浏览相关网站是不安全的,如下图所示:

enter image description here

我正在使用 Python 和 Seleinum 在 Firefox、Google Chrome 和 Internet Explorer 中启动网站(在 Windows XP 上):如果这些浏览器之一声明该网站不安全:是否有任何方法可以使用以下方式从浏览器检索此信息: Python ?任何想法都非常受欢迎。

最佳答案

如果你想测试一个网站是否被“标记”为危险使用,你根本不需要 Selenium 。通过查找向 Google Safebrowsing 发出请求 API :

Safe Browsing is a Google service that enables applications to check URLs against Google's constantly updated lists of suspected phishing and malware pages.

当然,还有一个python wrapper (可以生成API key here):

>>> key = 'your own key'
>>> from safebrowsinglookup import SafebrowsinglookupClient
>>> client = SafebrowsinglookupClient(key)

>>> client.lookup('http://addonrock.ru/Debugger.js')
{'http://addonrock.ru/Debugger.js': 'malware'}

>>> client.lookup('http://google.com')
{'http://google.com': 'ok'}

关于python - 不安全的浏览,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25033741/

相关文章:

javascript - Chrome Timeline 中的 JS 瓶颈

python - 如何以编程方式在 Jupyter Notebook 中创建多个新单元格

python - 使用额外参数 POST 数据 flask 的 Curl 命令 - 未使用的列

c# - 如何在 Windows Server 2008 的 IE8 中启用 ActiveX?

javascript - 带有 classList 的代码在 IE 中不起作用?

google-chrome - 访问 Google Chrome 的缓存

ios - 在 iOS 中聚焦 Select 时 Safari 和 Chrome 卡住

python - 使用 Python 3 将 Pig Latin 翻译成英语

python - 在 Python 中比较索引的目的是什么?

javascript - 即removeAttr标题问题