我正在尝试运行可以识别可疑网络钓鱼站点的代码(用Python编写)。我正在使用Selenium的chromedriver。这是我的代码:
import os, os.path, sys
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_experimental_option( "prefs", {'safebrowsing.enabled':1})
chromedriver = "my chromedriver path"
os.environ["webdriver.chrome.driver"] = chromedriver
driver = webdriver.Chrome(chromedriver, chrome_options=chrome_options)
driver.get('site url I want to check')我的代码在隐私设置中检查“启用网络钓鱼和恶意软件保护”中的“V”,但由于某些原因,在使用Chrome (而不是Python打开的窗口)时,我检查的网站被怀疑为网络钓鱼,并且我的Python代码打开的Chrome窗口没有显示任何与网络钓鱼相关的内容。
有什么想法吗?
发布于 2015-03-31 00:13:58
不使用selenium,直接使用Google Safe Browsing API (python wrapper):
>>> 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'}https://stackoverflow.com/questions/29350950
复制相似问题