I have been attempting to extract specific information from Gmail using javascript, but so far, I have not been successful. The code snippet that I am trying to retrieve is below:
<a href="https://mail.google.com/mail/u/0/#inbox" target="_top" class="J-Ke n0" title="Inbox (182)" tabindex="0">Inbox (182)</a>
My goal is to capture the text "Inbox (182)." To achieve this, I have implemented the following line of code:
NSString *js_result = [webview1 stringByEvaluatingJavaScriptFromString:@"document.getElementsByClassName('J-Ke n0').innerText"];
Unfortunately, this approach has not yielded any results as I receive an empty result. I have explored several alternatives without success. Any guidance on how to successfully extract the "Inbox (182)" text would be greatly appreciated. Thank you.