Accepting creteria-ish I have a website (not mine) that I display in WebView. Based on the content of the page, I would like to suggest my own click on the button (the button is not a problem).
What you need to do I need to check if the HTML content contains 2-3 specific URLs. URL can be 2-3 places on the page. If there are no URLs (sometimes they are, sometimes they do not fit), I need to do another content search to create the URL that I'm going to launch.
Possible solutions
- Screen screening with Objective-C -HMTL-Parser, HPPLE, ElemetParser, XPathQuery with libxml2 for HTML analysis and content search. Prons : Easy Cons : You need well-formed HTML / XML. Probably slow for many concurrent tree searches.
- Use regex. Prons :? Cons Difficult to read / write fast. We need well-formed HTML / XML. Probably slow for many concurrent searches. (Did not try RegexKit Light).
- Insert jQuery search functions into WebView and call functions from Objective-c. WebViewJavascriptBridge looks promising for use in betweean Js and ObjC (also looked at TGJSBridge, GAJavaScript and iOS-JavaScript-Bridge Prons : easily insert JQuery into WebViewJavascriptBridge code and invoke it using dele Cons : bulky.
- Is there any other solution that I skipped?
I am inclined to the decision nr. 3. using WebViewJavascriptBridge , where I would introduce jQuery search functions in a handler that will be called when it finds something. Can I run this search in multiple threads or do a tree search and find all my search items?
Summary
-1. What is the βbestβ / quick fix looking for (multi-user) content on the Internet that is not yours?
-2. Is there another solution I missed?
-3. Is it possible to run multiple jQuery searches in a thread, returning the results back to Objc every time something is found?
source share