-1

I have an application in asp.net core where I use selenium chromewebdriver. This app is used for web scraping which wors on my localhost IIS Express. My problem is that I want to deploy this app on Azure with possible to run headless chrome browser. I managed to to this but I had an error:

"unknown error: cannot find Chrome binary"

So I extracted the chromium but that didn't help, another error:

"unknown error: Failed to create a Chrome process. (Driver info: chromedriver=2.45.615291 (ec3682e3c9061c10f26ea9e5cdcf3c53f3f74387),platform=Windows NT 10.0.14393 x86_64)"

I heard about Azure WebJobs but it has limitation to 50MB.

Is it possible to do?

KJanek
  • 147
  • 1
  • 11
  • It would be awesome if you could provide a [mcve]. – mjwills Jan 03 '19 at 11:40
  • https://stackoverflow.com/questions/51958882/run-selenium-chrome-webdriver-on-azure-cloud-service?rq=1 https://stackoverflow.com/questions/53708299/headless-browser-in-azure-functions-javascript But this questions doesn't have code samples but people answered them so? – KJanek Jan 03 '19 at 11:50
  • 1
    @janek9971 that post you linked also explains how to fix your problem btw. – Timothy Groote Jan 03 '19 at 11:51
  • Possible duplicate of [Run Selenium Chrome WebDriver on Azure Cloud Service?](https://stackoverflow.com/questions/51958882/run-selenium-chrome-webdriver-on-azure-cloud-service) – Timothy Groote Jan 03 '19 at 11:54
  • @Timothy Groote I read that before asking, but couldn't understand Sangeet how to achieve it what he wrote. First answer referfs to PhantomJSDriver which I don't use. – KJanek Jan 03 '19 at 11:55

2 Answers2

2

Nope, impossible to do. Your question is similar with the other SO threads I had answered as below.

  1. Headless browser in Azure functions JavaScript?
  2. Can I use phantomJS on Azure app service for linux?

There is a new article Headless Selenium Browsers comes from InfoQ, it compares 5 options of headless browser which include Chrome Driver requires Chrome installed first. However, there is a limits about Win32k.sys (User32/GDI32) Restrictions of Azure Web App sandbox. So any library requires GDI support can not run on Azure WebApp, which even includes JBrowser requires libpng & libgd2.

Therefore, using VM to run headless browser is the only one solution on Azure.

Peter Pan
  • 23,476
  • 4
  • 25
  • 43
  • Thanks for reply, I changed approach and I use the website API to send request and scrape data without headless browser. – KJanek Jan 21 '19 at 17:12
-2

Have you tried Html Agility Pack for scraping?