これは、"user@website.com" を取得する必要がある HTML です。
<td valign="top">
<script type="text/javascript">
/* <![CDATA[ */
PrintMail('user','website.com','user<at>website.com', ' ');
/* ]]> */
</script><a href="JavaScript:SendMail('user','website.com');" onmouseover="self.status='user@website.com'; return true;" onmouseout="self.status=''; return true;">user@website.com</a><br>
これが私のコードです:
NSArray *emailNodes = [bodyNode findChildTags:@"td"];
for (HTMLNode *inputNode in emailNodes) {
if ([inputNode findChildrenWithAttribute:@"valign" matchingName:@"top" allowPartial:NO]) {
NSLog(@"%@", [[inputNode getAttributeNamed:@"href"] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]);
私が使用している HTML パーサーはこちらにあります: https://github.com/zootreeves/Objective-C-HMTL-Parser
最初の子、次の兄弟などを使用してコードを何百万回も変更しましたが、何も...
助けてくれてありがとう。