[wvPage stringByEvaluatingJavaScriptFromString:
@"function getDes(){var attrs = document.getElementsByClassName('description')[0];"
"attrs = attrs.getElementsByClassName('table')[0]"
"attrs = attrs.getElementsByTagName('li);"
"var result='',i;"
"for(i=0; i<attrs.length; i++)"
"{"
" result += attrs[i].getElementsByTagName('span')[0].innerHTML + ':' + attrs[i].getElementsByTagName('p')[1].innerHTML"
" if(i+1!=attrs.length)"
" result += '|'"
"}"
"return result;}"];
NSString* attribute_list = [wvPage stringByEvaluatingJavaScriptFromString:@"getDes()"];
我使用这些行来获取一个字符串但没有返回。怎么了?
目标HTML位于此处:http://d.pr/n/WT5a