selenium - python - identify suspected phishing sites
Question: I'm trying running code (in Python) that can identify suspected phishing
sites. I'm using Selenium's chromedriver. This is my code:

    
    
    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')
    

My code checks 'V' on "enable phishing and malware protection" in the privacy
settings, but for some reason while using Chrome (not the window one opened by
Python) the site I check is suspected as phishing and the Chrome window opened
by my Python code is not showing anything related to phishing.

Any ideas?


Answer: Instead of using `selenium`, use [Google Safe Browsing
API](https://developers.google.com/safe-browsing/) directly ([python
wrapper](https://github.com/juliensobrier/google-safe-browsing-lookup-
python)):

    
    
    >>> 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'}
    

