fill method

Future<Online> fill(
  1. Map<String, dynamic> map, {
  2. AbstractSelector? form,
})

Implementation

Future<Online> fill(Map<String, dynamic> map,
    {AbstractSelector? form}) async {
  try {
    form ??= Css('#webguiform0');
    var pageInstance = await page;
    var selected = await pageInstance.waitForSelector(form.selector);
    if (selected != null) {
      var inputs = await selected.evaluate('''(form) => {
        return Array.from(form.querySelectorAll('input')).map((e) => e);
      }''');
      print(inputs);
    }
    // Assume Online is a class, and it has a constructor that can be called without arguments
    return this;
  } catch (e) {
    print('Error: $e');
    // Handle error or rethrow
    rethrow;
  }
}