Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 在ios中解析HTML字符串_Iphone_Html_Ios_Ipad - Fatal编程技术网

Iphone 在ios中解析HTML字符串

Iphone 在ios中解析HTML字符串,iphone,html,ios,ipad,Iphone,Html,Ios,Ipad,我正在使用TFHpple成功地将html标记解析到ios中,但这里我遇到了一个小问题, 如果我的HTML标记是 <div align="center"> <b> <a href="/?PageName='TeacherPage'&StaffID=194121"> <span class="sectionheader">

我正在使用TFHpple成功地将html标记解析到ios中,但这里我遇到了一个小问题, 如果我的HTML标记是

 <div align="center">
            <b>
                <a href="/?PageName='TeacherPage'&StaffID=194121">
                    <span class="sectionheader">
                        Jessica
                        &nbsp;Cortes
                    </span>
                </a></b><BR>

                <span class="subheader">Migrant Education</span>
                <BR>

                    <img src="/images/Phone.gif" width="22" height="23"> 
                    912-367-8630
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/EmailIconSmall.gif" width="16" height="16" style="vertical-align:bottom" />
                    &nbsp; <a onclick="openme('z','/Common/Email/Email.asp?UserID=194121&SchoolID=786',417,320);return false;" href="#">Email</a>               

                <BR><BR>
                <a href="/?PageName='Teachers'&Category='Teachers'">View All Teachers</a>
                <BR><BR>
                <table cellpadding="4" cellspacing="4" class="subnavtd">


移民教育
912-367-8630



我使用示例将其解析到ios中:
NSString*tutorialxpathquerystring=@//div/span[@class='subheader']]


现在在其中一个HTML页面中没有标记,它只有一个数字,如
912-367-8630
now如何在
NSString*tutorialXPathQueryString=@“
此号码位于上述给定的标记中

您是否能够重新生成HTML输出并将该电话号码包装在您可以定位的标记中?如果没有,您可能需要获取字符串中电话号码模式的父div和regex匹配的内部文本值