Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99401

Install dependencies in Azure Functions with apt-get WITHOUT Docker

$
0
0

I am trying to use Azure Functions with Python with a consumption plan to scrape a web page using Selenium with Firefox. For the way it is going to be used, it is much more practical (and cheaper) to use a consumption plan, which means I can NOT use a Docker container.

So far I have been able to successfully include and path the binary files for Firefox along with the geckodriver binary file. I am getting the following error:

1571952497758   mozrunner::runner   INFO    Running command: "/home/site/wwwroot/SharedCode/bin/firefox/firefox""-marionette""--headless""-foreground""-no-remote""-profile""/tmp/rust_mozprofileFyNhwV"
XPCOMGlueLoad error for file /home/site/wwwroot/SharedCode/bin/firefox/libmozgtk.so:
libgtk-3.so.0: cannot open shared object file: No such file or directory
Couldn't load XPCOM.

I was under the impression that Firefox/Selenium did not need GTK if is running in headless mode (it is):

webdriver_options = selenium.webdriver.firefox.options.Options()
webdriver_options.binary_location = str( (pathlib.Path(__file__).parent / "../bin/firefox/firefox").resolve() )
webdriver_options.add_argument("--headless")

webdriver = selenium.webdriver.Firefox(executable_path=str( (pathlib.Path(__file__).parent / "../bin/geckodriver").resolve() ), firefox_options=webdriver_options)

This can be remedied just by installing GTK3. Is there any way to install packages with apt-get on an Azure Functions App without Docker?


Viewing all articles
Browse latest Browse all 99401

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>