Im using Wordpress plugin "WP Web Scraper" To easily gather some data from a site. The function wpws_get_content returns the result "Raised(number%)" I want to clean this up to just the number. Ive managed to return (90%) with the following code
<p id="number1"><?php echo wpws_get_content('http://my.sportrelief.com/sponsor/sachazarb', '#totalizer_percent', array( 'replace_query' => '/Raised/', 'replace_query_type' => 'regex', 'replace_with' => ' ', ) ); ?></p>
I cant work it out further. Its also, strangly, returning duplicate data, ie
<!--
Start of web scrap (created by wp-web-scraper)
Source URL: http://my.sportrelief.com/sponsor/sachazarb
Query: #totalizer_percent (cssselector)
Other options: Array
(
[headers] =>
[cache] => 60
[useragent] => WPWS bot (http://windreeladprint.com)
[timeout] => 2
[on_error] => error_show
[output] => html
[glue] =>
[eq] =>
[gt] =>
[lt] =>
[query_type] => cssselector
[remove_query] =>
[remove_query_type] => cssselector
[replace_query] => /Raised/
[replace_query_type] => regex
[replace_with] =>
[basehref] => 1
[a_target] =>
[callback_raw] =>
[callback] =>
[debug] => 1
[charset] => UTF-8
)
--><span id="totalizer_percent" class="percent"> (90%)</span><span id="totalizer_percent" class="percent"> (90%)</span><!--
End of web scrap
WPWS Cache Control: Remote-fetch via WP_Http
Computing time: 1.306 seconds
-->