java - how to save web-harvest data to database -
i scrapping data using web-harvest tool , getting required data i.e. name , price of product.
here config file.
<include path="functions.xml"/> <!-- collects tables individual products --> <var-def name="products"> <call name="download-multipage-list"> <call-param name="pageurl">http://www.amazon.de/s/ref=nb_sb_noss?__mk_de_de=amazon&url=search-alias%3daps&field-keywords=at300-103%20tegra%203%201gb</call-param> <call-param name="nextxpath">//a[@class="pagnnext"]/@href</call-param> <call-param name="itemxpath">//div[@class="fstrow prod"]</call-param> <call-param name="maxloops">10</call-param> </call> </var-def> <!-- iterates on collected products , extract desired data --> <file action="write" path="reports/catalog.xml" charset="utf-8"> <![cdata[ <catalog> ]]> <loop item="item" index="i"> <list><var name="products"/></list> <body> <xquery> <xq-param name="item" type="node()"><var name="item"/></xq-param> <xq-expression><![cdata[ declare variable $item node() external; let $name := data($item//*[@class='lrg bold']) let $price := data($item//*[@class='bld lrg red']) return <product> <name>{normalize-space($name)}</name> <price>{normalize-space($price)}</price> </product> ]]></xq-expression> </xquery> </body> </loop> <![cdata[ </catalog> ]]> </file>
now trying move name , price information mysql database table contains 2 columns name , price. got information have use database tag. not getting information how use that.
could please assist me how can configure in config file.
thanks in advance.
- sahiti
please go thorugh web-harvest.sourceforge.net/manual.php#database , try implement given.
Comments
Post a Comment