我的 webharvest 运行没有错误,但是当我打开 XML 文件时,它没有正确的数据,它只是打印出来。这是我的代码:
<?xml version="1.0" encoding="UTF-8"?>
<config charset="ISO-8859-1">
<file action="write" path="c:/Users/Username/Desktop/out.xml" charset="UTF-8">
<xquery>
<xq-param name="doc">
<html-to-xml>
<http url="http://www.realtor.com/realestateandhomes-detail/733-Weston-Park-Dr_Powell_OH_43065_M47208-73179"/>
</html-to-xml>
</xq-param>
<xq-expression><![CDATA[
declare variable $doc as node() external;
let $add := data($doc//div[@class="address"])
let $est := data($doc//div[@class = "estValue"])
let $bed := data($doc//div[@class="beds"])
let $bath := data($doc//div[@class="baths"])
let $lot := data($doc//div[@class="acres"])
let $sqft := data($doc//div[@class="sqft"])
return
<house>
<add>{data($add)}</add>
<est>{data($est)}</est>
<bed>{data($bed)}</bed>
<bath>{data($bath)}</bath>
<lot>{data($lot)}</lot>
<sqft>{data($sqft)}</sqft>
</house>
]]></xq-expression>
</xquery>
<![CDATA[ </realtor> ]]>
</file>
</config>