javawebharvest

WebHarvest not passing http-parameters via GET correcly


I am trying to get a webpage to parse using the following code.

<var-def name="parameter">value</var-def>
<var-def name="url">http://www.example.com/script</var-def>
<html-to-xml>
    <template>
        <http method="get" url="${url}">
            <http-param name="param"><var name="parameter"/></http-param>
        </http>
    </template>
</html-to-xml>

But instead of getting "value" as "param", script gets something like org.webharvest.runtime.web.HttpParamInfo@1983eae7. Same code with "post" method works OK, however this particular script requires "get" parameters. I've tried replacing <var name="parameter"/> with ${parameter.toString} but results are the same. How do I fix this?


Solution

  • Seems that it is impossible to pass GET parameters like that. Had to put them into the url, creating something like this<var-def name="url">http://www.example.com/script?parameter=value</var-def>