When tapping a link in the site displayed in Swift WKWebView
Is there a way to get linked characters?
How to get linked characters instead of URL.
Please tell me.
The source site is an arbitrary website, not your own.
Answer # 1
A linked character is a thing surrounded by a tags, right?
Please refer to the following page.
When callback occurs, receive using WKScriptMessageHandler.
Answer # 2
If you have created your own site, I think that js can be used.
If it is not (any website), I don't feel it as a simple method.
As a possible method, I came up with a technique that fetches the HTML of the web and pulls the a tag text that matches the URL of the link.
However, since it is not acquired from what was clicked, if there is the same link URL with different text, it can not be determined.
How to get HTML source read by WKWebView
- swift - [structure] there is only one type property for the structure
- swift - i want to get the nth title of backforwardlist of wkwebview
- ios - [swift] there is a code that i do not understand what is being processed by firebase login
- swiftui, i don't know how to write and retrieve when there is a dictionary in the dictionary
- swift - can't start even though there are no errors
- swift - is there a good way to get the index of the last element in the array that matches the condition?
- Swift uses WKWebView to call the web in iOS applications
- swift - is there a way to apply colorset's anyappearance?
- swift - when scrolling with tableview, there may be cells that are not laid out
- swift - is there a way to get the name of systemcolor?
- ios - [swift] firebase there is a bug whose meaning is not well understood
- swift - is there anyone who knows each method short for and ifelse?
- python 3x - typeerror: 'method' object is not subscriptable
- python - you may need to restart the kernel to use updated packages error
- xcode - pod install [!] no `podfile 'found in the project directory
- vuejs - [vuetify] unable to locate target [data-app] i want to unit test to avoid warning
- android studio - emulator: dsound: could not initialize about the error message directsoundcapture
- android studio - unresolved reference comes out in kotlin
- mysql startup failed [error] innodb: the innodb_system data file 'ibdata1' must be writable
- django - oserror: [winerror 123] the file name, directory name, or volume label syntax is incorrect : '<frozen importlib_boot
- python - importerror: cannot import name md5 error cannot be resolved