<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using Selenium Chrome Driver in Databricks, runs the first time but fails after that in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/using-selenium-chrome-driver-in-databricks-runs-the-first-time/m-p/35039#M25724</link>
    <description>&lt;P&gt;Here is the solution that I discovered:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;s = Service(chromedriver_path)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and at the end of the notebook I run:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;driver.quit()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I got rid of driver.stop_client(), driver.close(), and s.stop()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The driver.quit() closes all chrome windows and stops the driver and allows me to run the script again without having to restart the cluster.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Aug 2022 00:39:45 GMT</pubDate>
    <dc:creator>Tripalink</dc:creator>
    <dc:date>2022-08-11T00:39:45Z</dc:date>
    <item>
      <title>Using Selenium Chrome Driver in Databricks, runs the first time but fails after that</title>
      <link>https://community.databricks.com/t5/data-engineering/using-selenium-chrome-driver-in-databricks-runs-the-first-time/m-p/35038#M25723</link>
      <description>&lt;P&gt;I have a notebook that uses a Selenium Web Driver for Chrome  and it works the first time I run the notebook. If I run the notebook again, it will not work and gives the error message: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WebDriverException: Message: unknown error: unable to discover open pages Stacktrace: #0 0x560b13ce5e89 &amp;lt;unknown&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code that results in the error message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chromedriver_path = '/local_disk0/tmp/chromedriver'&lt;/P&gt;&lt;P&gt;chromebinary_path = '/usr/bin/google-chrome'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;s = Service(ChromeDriverManager().install())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options = Options()&lt;/P&gt;&lt;P&gt;options.binary_location = chromebinary_path&lt;/P&gt;&lt;P&gt;options.add_argument('--disable-gpu')&lt;/P&gt;&lt;P&gt;options.add_argument('--no-sandbox')&lt;/P&gt;&lt;P&gt;#options.add_argument('--remote-debugging-port=9222')&lt;/P&gt;&lt;P&gt;options.add_argument("--remote-debugging-port=9230")&lt;/P&gt;&lt;P&gt;options.add_argument('--disable-dev-shm-usage')&lt;/P&gt;&lt;P&gt;options.headless = True&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;driver = webdriver.Chrome(service=s, options=options)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, at the end of my notebook I have the following code which may be part of the problem, not sure:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;driver.stop_client()&lt;/P&gt;&lt;P&gt;driver.close()&lt;/P&gt;&lt;P&gt;driver.quit()&lt;/P&gt;&lt;P&gt;s.stop()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What can I change to be able to run the notebook as many times as I would like without having it give that error message.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 17:56:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/using-selenium-chrome-driver-in-databricks-runs-the-first-time/m-p/35038#M25723</guid>
      <dc:creator>Tripalink</dc:creator>
      <dc:date>2022-08-08T17:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using Selenium Chrome Driver in Databricks, runs the first time but fails after that</title>
      <link>https://community.databricks.com/t5/data-engineering/using-selenium-chrome-driver-in-databricks-runs-the-first-time/m-p/35039#M25724</link>
      <description>&lt;P&gt;Here is the solution that I discovered:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;s = Service(chromedriver_path)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and at the end of the notebook I run:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;driver.quit()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I got rid of driver.stop_client(), driver.close(), and s.stop()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The driver.quit() closes all chrome windows and stops the driver and allows me to run the script again without having to restart the cluster.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 00:39:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/using-selenium-chrome-driver-in-databricks-runs-the-first-time/m-p/35039#M25724</guid>
      <dc:creator>Tripalink</dc:creator>
      <dc:date>2022-08-11T00:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using Selenium Chrome Driver in Databricks, runs the first time but fails after that</title>
      <link>https://community.databricks.com/t5/data-engineering/using-selenium-chrome-driver-in-databricks-runs-the-first-time/m-p/35040#M25725</link>
      <description>&lt;P&gt;Hi, @Dagart Allison​&amp;nbsp;. I've created a new version of the selenium with the databricks manual. Please look here &lt;A href="https://community.databricks.com/s/feed/0D58Y00009SWgVuSAL" alt="https://community.databricks.com/s/feed/0D58Y00009SWgVuSAL" target="_blank"&gt;https://community.databricks.com/s/feed/0D58Y00009SWgVuSAL&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 14:25:58 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/using-selenium-chrome-driver-in-databricks-runs-the-first-time/m-p/35040#M25725</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-11-09T14:25:58Z</dc:date>
    </item>
  </channel>
</rss>

