dart-websocket icon indicating copy to clipboard operation
dart-websocket copied to clipboard

exception with websocket

Open focode opened this issue 5 years ago • 2 comments
trafficstars

I am trying to run this code from the example:

import 'package:puppeteer/puppeteer.dart';

void main() async {
  // Download the Chromium binaries, launch it and connect to the "DevTools"
  var browser = await puppeteer.launch();

  // Open a new tab
  var myPage = await browser.newPage();

  // Go to a page and wait to be fully loaded
  await myPage.goto('https://www.github.com', wait: Until.networkIdle);

  // Do something... See other examples
  await myPage.screenshot();
//  await myPage.pdf();
  await myPage.evaluate('() => document.title');

  // Gracefully close the browser's process
  await browser.close();
}

and I am getting this exception:

Unhandled exception:
Exception: Websocket url not found
#0      _waitForWebSocketUrl (package:puppeteer/src/puppeteer.dart:311:3)
<asynchronous suspension>
#1      Puppeteer.launch (package:puppeteer/src/puppeteer.dart:170:30)
<asynchronous suspension>
#2      main (file:///D:/project/IOT-KT/dl/puppy1/test/puppy1_test.dart:8:33)
#3      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:307:19)
#4      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)

focode avatar Mar 05 '20 14:03 focode

Thank you for reporting. I'm traveling right now, and will get back to this soon.

truongsinh avatar Mar 09 '20 16:03 truongsinh