Michelangelo27 / chatgpt_selenium_automation

MIT License
87 stars 31 forks source link

Some arguments might be outdated #3

Closed matteo-rizzo closed 5 months ago

matteo-rizzo commented 5 months ago

Hi, and thank you for your work!

I tried using the code, but the executable-path argument in webdriver.Chrome within the setup_webdriver function is throwing an error. The following works:

  def setup_webdriver(self, port):
      """  Initializes a Selenium WebDriver instance, connected to an existing Chrome browser
           with remote debugging enabled on the specified port"""

      chrome_options = webdriver.ChromeOptions()
      chrome_options.binary_location = self.chrome_driver_path
      chrome_options.add_experimental_option("debuggerAddress", f"127.0.0.1:{port}")
      driver = webdriver.Chrome(options=chrome_options)
      return driver

Similarly, in the function send_prompt_to_chatgpt, the input box could not be found via XPath using the current expression. The expression //textarea[contains(@id, "prompt-textarea")] fixes the problem.

I will send a pull request with the changes soon, have a good day :)

Michelangelo27 commented 5 months ago

Hi Matteo, thank you for helping keep the project updated :)