Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I would recommend using cURL to actually make the call then DOM to parse. The advantage to using DOM is allowing you a little bit of leeway when it comes to changes on the website. The advantage to curl being extended flexibility and the ability to return errors. This will require quite a bit of studying on your part in order to determine the correct values to look for. The below code should get you started:</p> <pre><code>// Curl function curl($url, $post=''){ //cURL options $options = array( CURLOPT_RETURNTRANSFER =&gt; true, // return web page CURLOPT_HEADER =&gt; false, // don't return headers CURLOPT_FOLLOWLOCATION =&gt; true, // follow redirects CURLOPT_ENCODING =&gt; "", // handle all encodings CURLOPT_AUTOREFERER =&gt; true, // set referer on redirect CURLOPT_CONNECTTIMEOUT =&gt; 500, // timeout on connect CURLOPT_TIMEOUT =&gt; 500, // timeout on response CURLOPT_MAXREDIRS =&gt; 10, // stop after 10 redirects CURLOPT_SSL_VERIFYHOST =&gt; 0, CURLOPT_SSL_VERIFYPEER =&gt; 0, CURLOPT_USERAGENT =&gt; "", CURLOPT_COOKIESESSION =&gt; false, CURLOPT_COOKIEJAR =&gt; $this-&gt;ckfile, // Cookies CURLOPT_COOKIEFILE =&gt; $this-&gt;ckfile, //Cookies...yum ); //Go go go! $ch = curl_init( $url ); curl_setopt_array( $ch, $options ); $output['content'] = curl_exec( $ch ); $output['err'] = curl_errno( $ch ); $output['errmsg'] = curl_error( $ch ); $output['header'] = curl_getinfo( $ch ); return $output; } </code></pre> <p>Once you have $output, you can parse with DOM. Few ways you can go about it, I recommend XPATH queries</p> <pre><code>//Create DOM $doc = new DOMDocument; @$doc-&gt;loadHTML($curl['content']); $doc-&gt;preserveWhiteSpace = false; $xpath = new DOMXpath($doc); $nodeList = $xpath-&gt;query("//div[@id='test']"); // I would recommend trying to find an element that contains the currency elements, but has an attribute that will most likely not be changed. IDs work well, sometime div classes also work. Check out http://www.exampledepot.com/egs/org.w3c.dom/xpath_GetElemByText.html foreach($nodeList as $node){ // From here you would want to select the element http://php.net/manual/en/domdocument.getelementsbytagname.php } </code></pre> <p>From there you return it. I would instead recommend parsing <a href="http://themoneyconverter.com/RSSFeeds.aspx" rel="nofollow">http://themoneyconverter.com/RSSFeeds.aspx</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload