ChromeDriver malfunctions when I change it (Selenium, Python)

79 Views Asked by At

chromedriver (using WebDriver) has abuilt-in backdoor which informs Javascript webPages taht you are automatically scraping their HTML/JS

I tried to disable that unique character by replacing it within ChromeDriver.exe. When I do that the scraper breaks. What i changed in Chrome is switching the var key= '$cdc_asdjflasutopfhvcZLmcfl_' into an equally long string of chars, ints and letters(?). IDK enough about Hexadecimal to say what all this is but this is what some article on Jscript says to do so ChromeDriver doesn't stop when you scrape

    driver = webdriver.Chrome(options=options, executable_path=PATH);
        {even though I include the path defined and it worked fine a second ago!}
   super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
   RemoteWebDriver.__init__(
   self.start_session(capabilities, browser_profile)
   response = self.execute(Command.NEW_SESSION, parameters)
   self.error_handler.check_response(response)
   raise exception_class(message, screen, stacktrace)
   selenium.common.exceptions.SessionNotCreatedException: Message: session not         created
from unknown error: Runtime.evaluate threw exception: SyntaxError: Invalid or unexpected token

  (Session info: chrome=106.0.5249.61)

Please help! I am scraping a site my company pays for

1

There are 1 best solutions below

1
user13855500 On

THat's a tough one. I would suggest reinstalling python and selenium. did you retrieve any rotten virusses?