string.xml解析一例

admin2020-12-09  2.6K+

import string.xml;

var html=string.xml(网页源码2);
var eleRecords = html.queryEles(tagName="input";)
text=""
for i,record in table.eachIndex(eleRecords){
	if( record.name!=null){
		value=record.value
		name=record.name
		text += string.concat(name, '=' ,value,'&')
		//text += string.concat(name,'=',value)
		//text=text+name+"="+value+" &"
	}
}
import inet.url ;
return inet.url.encodeUri(text);

 

t={}
for i,record in table.eachIndex(eleRecords){
		if( record.name !=null){
    			value=record.value
    			name=record.name
    			table.push(t,string.concat(name,'=',value))
				//text=text+name+"="+value+"&"
		}
	}
text=string.join(t,"&")
//text=string.left(text,#text-1) //#text代表text的长度
转载请注明原文地址: https://www.aardio.net/read-36.html
最新回复(0)
aardio问答
aardio编程语言