Problems with Selenium + Python (My script detected as malware in Chrome and selenium.webdriver 'has no attribute' FireFox)

0

I'm trying Selenium for the first time. I've only written four lines of code and I already have problems:

First I tried to work with Chrome

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

_chrome_options.add_argument("disable-infobars")
_chrome_options.add_argument("disable-popup-blocking")
driver = webdriver.Chrome(executable_path="chromedriver.exe", chrome_options=_chrome_options)

driver.get("http://www.python.org")
driver.close()

It runs fine, but when the browser opens I get a message from the Microsoft antimalware program and the page automatically closes so fast that it does not give me time to read it.

"""
Herramienta de eliminación de software malintenc. de Microsoft quiere restablecer la configuración predeterminada original de Chrome. 

Se restablecerá la página principal, la página Nueva pestaña y el motor de búsqueda. Asimismo, se inhabilitarán las extensiones y no se fijará ninguna pestaña. 

También se borrarán los datos temporales y los almacenados en la memoria caché, como las cookies, el contenido y los datos de sitios. Más información
"""

I tried to uninstall this tool from Microsoft for two reasons, first because it does not do its job well and second because it does not let me schedule ... but it is not in the list of installed programs and I can not find it anywhere. Does anyone know how to remove this annoying tool or at least disable it or make an exception so that I can execute my script? The script I want to run in my machine so I do not care if it does not work in others.

I also tried to do it with FireFox to see if I had more luck

from selenium import webdriver
driver = webdriver.FireFox()
driver.get("http://www.google.com")
driver.close()

But I get this error

Traceback (most recent call last):
  File "bot.py", line 29, in <module>
    driver = webdriver.FireFox()
AttributeError: module 'selenium.webdriver' has no attribute 'FireFox'

Probably that way of doing it has been deprecated ... So I could not do anything with Selenium. Any solution?

    
asked by Iván Rodríguez 07.07.2018 в 13:29
source

0 answers