I am using flutter_inappwebview: any in project, So I am loading webview with this package and I want to track some events from that webview part. So my code is as follows
Widget build(BuildContext context) {
return SafeArea(
child: InAppWebView(
initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(javaScriptEnabled: true)),
onWebViewCreated: (controller) {
webViewController = controller;
WidgetsBinding.instance?.addPostFrameCallback((_) {
Timer(
Duration(seconds: 6),
() => (webviewTracking()),
);
});
},
onConsoleMessage: (controller, consoleMessage) {
print(consoleMessage);
},
initialUrlRequest: URLRequest(
url: Uri.parse(
"https://**********.com/#/*******",
)),
),
);
}
I want to track events from following div method. Here is the div/span code of html webview. How can I detect events that is assigned with numbers?
<div data-v-4437aff0="" class="native-box">
<div data-v-4437aff0="" class="rtc__jian-pan">
<span data-v-4437aff0="">1</span>
<span data-v-4437aff0="">2</span>
<span data-v-4437aff0="">3</span>
<span data-v-4437aff0="">4</span>
<span data-v-4437aff0="">5</span>
<span data-v-4437aff0="">6</span>
<span data-v-4437aff0="">7</span>
<span data-v-4437aff0="">8</span>
<span data-v-4437aff0="">9</span>
<span data-v-4437aff0="" class="kong">Cancel</span>
<span data-v-4437aff0="" class="ling">0</span>
<span data-v-4437aff0="" class="icon">
<i data-v-4437aff0="" class="van-icon van-icon-delete-o">
<!---->
</i>
</span>
</div>
</div>
</div>
Is it possible? Any help would be appreciated.