Giter Club home page Giter Club logo

azure-function-selenium's People

Contributors

devhawkio avatar gavindavies avatar komayama avatar rebremer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

azure-function-selenium's Issues

How to adapt & debug your azure function app?

Thank you so much for sharing your work.

With some adjustments I was able to successfully replicate your setup and use the http_trigger to crawl http://www.ubuntu.com/. However, I have some issues trying to adjust the script. How would you go about changing the code from HttpTrigger \ init.py ?

I tried,

  1. change init.py code locally
  2. docker build --tag $acr_id/selenium .
  3. docker push $acr_id/selenium:latest
  4. az functionapp delete (current app)
  5. az functionapp create --resource-group $rg --os-type Linux --plan $plan --deployment-container-image-name $acr_id/selenium:latest --name $fun --storage-account $stor --functions-version 2
  6. ...

This procedure takes quite a lot of time, especially when trying to debug the code changes. Since I'm pretty new to docker and azure, I'm pretty sure this isn't the most effective way to adjust/debug/update the system. If you could provide any assistance, that'd be greatly appreciated.

Thank you!

Exception: WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally.

I have followed all the steps which you have described but I got the error which i don't understand

Here is the whole error

Function.MadridCrawlHTTPTrigger[3]
Executed 'Functions.MadridCrawlHTTPTrigger' (Failed, Id=33e192ec-956b-4bde-a629-16bf2040eb99, Duration=3148ms)
Microsoft.Azure.WebJobs.Host.FunctionInvocationException: Exception while executing function: Functions.MadridCrawlHTTPTrigger
---> Microsoft.Azure.WebJobs.Script.Workers.Rpc.RpcException: Result: Failure
Exception: WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Stacktrace:
#0 0x5572e95882a3
#1 0x5572e9346f77
#2 0x5572e936f5f7
#3 0x5572e936b7d0
#4 0x5572e93ac0b7
#5 0x5572e93aba5f
#6 0x5572e93a3903
#7 0x5572e9376ece
#8 0x5572e9377fde
#9 0x5572e95d863e
#10 0x5572e95dbb79
#11 0x5572e95be89e
#12 0x5572e95dca83
#13 0x5572e95b1505
#14 0x5572e95fdca8
#15 0x5572e95fde36
#16 0x5572e9619333
#17 0x7f95e9361ea7 start_thread

  Stack:   File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py", line 458, in _handle__invocation_request
      call_result = await self._loop.run_in_executor(
    File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
      result = self.fn(*self.args, **self.kwargs)
    File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py", line 701, in _run_sync_func
      return ExtensionManager.get_sync_invocation_wrapper(context,
    File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/extension.py", line 215, in _raw_invocation_wrapper
      result = function(**args)
    File "/home/site/wwwroot/function_app.py", line 168, in selenium_function
      madridcrawler = MadridCrawler(conn)
    File "/home/site/wwwroot/src/madrid_updater.py", line 61, in __init__
      self.driver = webdriver.Chrome(options= options, service=Service(ChromeDriverManager().install()))

Please help me out
Thank You

Result: Failure Exception: TypeError: expected str, bytes or os.PathLike object, not Service Stack: File

I have followed all the steps which you have described but I got the error which i dont understand

Here is the whole error

Result: Failure Exception: TypeError: expected str, bytes or os.PathLike object, not Service Stack: File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py", line 407, in _handle__invocation_request call_result = await self._loop.run_in_executor( File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py", line 649, in _run_sync_func return ExtensionManager.get_sync_invocation_wrapper(context, File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/extension.py", line 215, in _raw_invocation_wrapper result = function(**args) File "/home/site/wwwroot/trail_cx3/init.py", line 37, in main driver = webdriver.Chrome(service, options=chrome_options) File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 69, in init super().init(DesiredCapabilities.CHROME['browserName'], "goog", File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/chromium/webdriver.py", line 89, in init self.service.start() File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line 71, in start self.process = subprocess.Popen(cmd, env=self.env, File "/usr/local/lib/python3.9/subprocess.py", line 951, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/local/lib/python3.9/subprocess.py", line 1696, in _execute_child and os.path.dirname(executable) File "/usr/local/lib/python3.9/posixpath.py", line 152, in dirname p = os.fspath(p)

Please help me out

Thank You

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.