0

I am using PuppeteerSharp in C#.

I would like to use await page.GoToAsync(localPath); but faced below exception:

Protocol error (Page.navigate): Cannot navigate to invalid URL

How can I support browsing local path instead of HTTPS?

DaiKeung
  • 1,077
  • 1
  • 19
  • 38

1 Answers1

0

For local path, need to use file protocol like below:

await page.GoToAsync("file://" + Path.Combine(context.FunctionAppDirectory, "www", "index.html"));
DaiKeung
  • 1,077
  • 1
  • 19
  • 38