{"id":678,"date":"2016-11-17T11:28:36","date_gmt":"2016-11-17T11:28:36","guid":{"rendered":"https:\/\/www.ephiquant.com\/?p=678"},"modified":"2016-11-26T07:09:50","modified_gmt":"2016-11-26T07:09:50","slug":"web-scraping-avec-r-extration-des-cours-depuis-le-site-de-la-bourse-de-casablanca","status":"publish","type":"post","link":"https:\/\/www.ephiquant.com\/?p=678","title":{"rendered":"Web Scraping avec R, Extration des cours depuis le site de la Bourse de Casablanca"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>Nous avons l&#8217;habitude de manipuler des donn\u00e9es contenues dans des fichiers ou syst\u00e8me bien structur\u00e9 et adapt\u00e9 \u00e0 cet effet. Oui heureusement, nous avons des packages qui ont \u00e9t\u00e9 bien con\u00e7us sp\u00e9cialement pour faire la partie &#8220;d\u00e9sagr\u00e9able&#8221; du boulot. Maintenant imaginons que l&#8217;on veuille extraire un tableau contenu sur une page web comme celui de la <a href=\"http:\/\/www.casablanca-bourse.co.ma\/bourseweb\/Negociation-Historique.aspx?Cat=24&amp;IdLink=302\">bourse de Casablanca<\/a>:<\/p>\n<div id=\"attachment_682\" style=\"width: 1146px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.casablanca-bourse.co.ma\/bourseweb\/Negociation-Historique.aspx?Cat=24&amp;IdLink=302\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-682\" class=\"wp-image-682 size-full\" src=\"https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/sitebourse-de-Casablanca.png\" alt=\"http:\/\/www.casablanca-bourse.co.ma\/bourseweb\/Negociation-Historique.aspx?Cat=24&amp;IdLink=302\" width=\"1136\" height=\"605\" srcset=\"https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/sitebourse-de-Casablanca.png 1136w, https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/sitebourse-de-Casablanca-300x160.png 300w, https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/sitebourse-de-Casablanca-768x409.png 768w, https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/sitebourse-de-Casablanca-1024x545.png 1024w\" sizes=\"auto, (max-width: 1136px) 100vw, 1136px\" \/><\/a><p id=\"caption-attachment-682\" class=\"wp-caption-text\">Capture d&#8217;\u00e9cran du site de la bourse de Casablanca<\/p><\/div>\n<p>Malheureusement ou heureusement pour nous, s&#8217;il existe des packages comme le fameux\u00a0<span style=\"color: #0000ff;\">quantmod <\/span>tr\u00e8s\u00a0utiliser par les quants pour t\u00e9l\u00e9charger notamment avec la fonction <span style=\"color: #0000ff;\">getSymbols()<\/span>, les cours boursiers depuis la plateforme de <strong>Yahoofinance<\/strong> ou <strong>Googlefinance<\/strong>&#8230;etc, il n&#8217;en existe pas pour la bourse de Casablanca et nous allons \u00e0 travers cet tutoriel\u00a0concevoir une fonction qui pourra :<\/p>\n<ul>\n<li>&#8211; Naviguer sur le site en cochant les diff\u00e9rentes options que l&#8217;utilisateur aura entr\u00e9<\/li>\n<li>&#8211; Extraire le tableau des donn\u00e9es affich\u00e9 sur le site et le pr\u00e9parer pour son utilisation avec <strong>R (<\/strong>comme on peut voir l&#8217;image au d\u00e9but de cet article pr\u00e9sente les cours de la soci\u00e9t\u00e9 <strong>ATTIJARIWAFABANK)<\/strong><\/li>\n<\/ul>\n<h3>Etape I : RSelenium, package pour la navigation web<\/h3>\n<p><a href=\"http:\/\/docs.seleniumhq.org\">Selenium<\/a>, est un projet visant \u00e0 automatiser la navigation web et en l&#8217;occurence sa version R, nomm\u00e9e RSelenium permet de naviguer via des commandes R. Bien que l&#8217;int\u00e9r\u00eat de ce package va bien au del\u00e0 de la simple navigation web, nous allons l&#8217;utiliser pour communiquer avec notre site cible.<\/p>\n<p>Ainsi, pour fonctionner, nous avons besoin d&#8217;un navigateur web firefox, Google Chrome&#8230;etc. Mais malheureusement ces derniers ne fonctionnent souvent pas. Mais nous avons mieux, nous allons opter pour une navigation fantome ( dans le sens o\u00f9 tout se passera en background et nous ne verrons rien apparaitre pendant la navigation autrement ce serait emb\u00eatant). Pour ce faire, nous allons utiliser le\u00a0navigateur <a href=\"http:\/\/phantomjs.org\">PhantomJS<\/a>, on peut le t\u00e9l\u00e9charger <a href=\"https:\/\/bitbucket.org\/ariya\/phantomjs\/downloads\/phantomjs-2.1.1-windows.zip\">ici<\/a>. Apr\u00e8s t\u00e9l\u00e9chargement, il suffit de d\u00e9compresser le dossier dans un endroit facilement accessible. Ensuite on aura besoin du chemin d&#8217;acc\u00e8s(<span class=\"lang:r decode:true crayon-inline\">C:\/Users\/danam\/Documents\/phantomjs-2.1.1-windows\/bin\/phantomjs.exe<\/span>) \u00e0 l\u2019ex\u00e9cutable\u00a0<em>phantomjs.exe<\/em> log\u00e9 dans le dossier <span class=\"lang:r decode:true crayon-inline \">bin<\/span>\u00a0.<\/p>\n<pre class=\"lang:r decode:true\">require(RSelenium)\r\ne &lt;- list(phantomjs.binary.path = 'C:\/Users\/danam\/Documents\/phantomjs-2.1.1-windows\/bin\/phantomjs.exe')\r\nremDr &lt;- remoteDriver(browserName = 'phantomjs', extraCapabilities = e)\r\nremDr<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ephiquant.com\/wp-content\/ql-cache\/quicklatex.com-25842a46d90b983956bd2fc114a482d7_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#111;&#112;&#101;&#110;&#40;&#115;&#105;&#108;&#101;&#110;&#116;&#32;&#61;&#32;&#84;&#82;&#85;&#69;&#41; &#117;&#114;&#108;&#32;&#60;&#45;&#32;&#39;&#104;&#116;&#116;&#112;&#58;&#47;&#47;&#119;&#119;&#119;&#46;&#99;&#97;&#115;&#97;&#98;&#108;&#97;&#110;&#99;&#97;&#45;&#98;&#111;&#117;&#114;&#115;&#101;&#46;&#99;&#111;&#46;&#109;&#97;&#47;&#98;&#111;&#117;&#114;&#115;&#101;&#119;&#101;&#98;&#47;&#78;&#101;&#103;&#111;&#99;&#105;&#97;&#116;&#105;&#111;&#110;&#45;&#72;&#105;&#115;&#116;&#111;&#114;&#105;&#113;&#117;&#101;&#46;&#97;&#115;&#112;&#120;&#63;&#67;&#97;&#116;&#61;&#50;&#52;&#38;&#73;&#100;&#76;&#105;&#110;&#107;&#61;&#51;&#48;&#50;&#39; &#114;&#101;&#109;&#68;&#114;\" title=\"Rendered by QuickLaTeX.com\" height=\"59\" width=\"582\" style=\"vertical-align: -1px;\"\/>navigate(url)\r\nremDr<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ephiquant.com\/wp-content\/ql-cache\/quicklatex.com-c7c725d1cf1f2c5e568c46fe99fd81ee_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#115;&#99;&#114;&#101;&#101;&#110;&#115;&#104;&#111;&#116;&#40;&#100;&#105;&#115;&#112;&#108;&#97;&#121;&#32;&#61;&#32;&#84;&#82;&#85;&#69;&#41;&#60;&#47;&#112;&#114;&#101;&#62; &#69;&#110;&#32;&#115;&#117;&#112;&#112;&#111;&#115;&#97;&#110;&#116;&#44;&#32;&#113;&#117;&#101;&#32;&#108;&#39;&#111;&#110;&#32;&#97;&#32;&#100;&eacute;&#106;&agrave;&#32;&#105;&#110;&#115;&#116;&#97;&#108;&#108;&eacute;&#32;&#60;&#115;&#112;&#97;&#110;&#32;&#115;&#116;&#121;&#108;&#101;&#61;&#34;&#99;&#111;&#108;&#111;&#114;&#58;&#32;&#35;&#48;&#48;&#48;&#48;&#102;&#102;&#59;&#34;&#62;&#82;&#83;&#101;&#108;&#101;&#110;&#105;&#117;&#109;&#60;&#47;&#115;&#112;&#97;&#110;&#62;&#44;&#32;&#111;&#110;&#32;&#108;&#101;&#32;&#99;&#104;&#97;&#114;&#103;&#101;&#32;&#100;&#97;&#110;&#115;&#32;&#108;&#39;&#101;&#110;&#118;&#105;&#114;&#111;&#110;&#110;&#101;&#109;&#101;&#110;&#116;&#32;&#100;&#101;&#32;&#116;&#114;&#97;&#118;&#97;&#105;&#108;&#32;&#40;&#108;&#105;&#103;&#110;&#101;&#32;&#49;&#41;&#32;&#101;&#116;&#32;&#112;&#111;&#117;&#114;&#32;&#100;&eacute;&#109;&#97;&#114;&#114;&#101;&#114;&#32;&#108;&#97;&#32;&#110;&#97;&#118;&#105;&#103;&#97;&#116;&#105;&#111;&#110;&#32;&agrave;&#32;&#100;&#105;&#115;&#116;&#97;&#110;&#99;&#101;&#32;&#105;&#108;&#32;&#101;&#115;&#116;&#32;&#110;&eacute;&#99;&#101;&#115;&#115;&#97;&#105;&#114;&#101;&#32;&#100;&#39;&eacute;&#116;&#97;&#98;&#108;&#105;&#114;&#32;&#108;&#101;&#32;&#98;&#114;&#97;&#110;&#99;&#104;&#101;&#109;&#101;&#110;&#116;&#32;&#97;&#118;&#101;&#99;&#32;&#60;&#115;&#116;&#114;&#111;&#110;&#103;&#62;&#112;&#104;&#97;&#110;&#116;&#111;&#109;&#106;&#115;&#60;&#47;&#115;&#116;&#114;&#111;&#110;&#103;&#62;&#40;&#108;&#105;&#103;&#110;&#101;&#32;&#51;&#41;&#46;&#32;&#67;&#39;&#101;&#115;&#116;&#32;&#115;&#117;&#114;&#32;&#108;&#97;&#32;&#98;&#97;&#115;&#101;&#32;&#100;&#101;&#32;&#99;&#101;&#32;&#98;&#114;&#97;&#110;&#99;&#104;&#101;&#109;&#101;&#110;&#116;&#32;&agrave;&#32;&#116;&#114;&#97;&#118;&#101;&#114;&#115;&#32;&#108;&#39;&#111;&#98;&#106;&#101;&#116;&#32;&#60;&#115;&#116;&#114;&#111;&#110;&#103;&#62;&#114;&#101;&#109;&#68;&#114;&#60;&#47;&#115;&#116;&#114;&#111;&#110;&#103;&#62;&#32;&#113;&#117;&#101;&#32;&#110;&#111;&#117;&#115;&#32;&#97;&#108;&#108;&#111;&#110;&#115;&#32;&#112;&#111;&#117;&#118;&#111;&#105;&#114;&#32;&#97;&#99;&#99;&eacute;&#100;&#101;&#114;&#32;&agrave;&#32;&#117;&#110;&#101;&#32;&#112;&#108;&#97;&#116;&#101;&#102;&#111;&#114;&#109;&#101;&#32;&#119;&#101;&#98;&#32;&agrave;&#32;&#100;&#105;&#115;&#116;&#97;&#110;&#99;&#101;&#46;&#32;&#76;&#97;&#32;&#102;&#111;&#110;&#99;&#116;&#105;&#111;&#110;&#32;&#60;&#115;&#112;&#97;&#110;&#32;&#115;&#116;&#121;&#108;&#101;&#61;&#34;&#99;&#111;&#108;&#111;&#114;&#58;&#32;&#35;&#48;&#48;&#48;&#48;&#102;&#102;&#59;&#34;&#62;&#110;&#97;&#118;&#105;&#103;&#97;&#116;&#101;&#40;&#41;&#60;&#47;&#115;&#112;&#97;&#110;&#62;&#44;&#32;&#118;&#97;&#32;&#110;&#111;&#117;&#115;&#32;&#112;&#101;&#114;&#109;&#101;&#116;&#116;&#114;&#101;&#32;&#100;&#39;&#97;&#99;&#99;&eacute;&#100;&#101;&#114;&#32;&#97;&#117;&#32;&#115;&#105;&#116;&#101;&#32;&#119;&#101;&#98;&#32;&#100;&#111;&#110;&#116;&#32;&#108;&#101;&#32;&#108;&#105;&#101;&#110;&#32;&#101;&#115;&#116;&#32;&#102;&#111;&#117;&#114;&#110;&#105;&#32;&#101;&#110;&#32;&#97;&#114;&#103;&#117;&#109;&#101;&#110;&#116;&#32;&#101;&#116;&#32;&#108;&#97;&#32;&#100;&#101;&#114;&#110;&#105;&egrave;&#114;&#101;&#32;&#102;&#111;&#110;&#99;&#116;&#105;&#111;&#110;&#32;&#60;&#115;&#112;&#97;&#110;&#32;&#115;&#116;&#121;&#108;&#101;&#61;&#34;&#99;&#111;&#108;&#111;&#114;&#58;&#32;&#35;&#48;&#48;&#48;&#48;&#102;&#102;&#59;&#34;&#62;&#115;&#99;&#114;&#101;&#101;&#110;&#115;&#104;&#111;&#116;&#40;&#41;&#60;&#47;&#115;&#112;&#97;&#110;&#62;&#44;&#32;&#112;&#101;&#114;&#109;&#101;&#116;&#32;&#100;&#39;&#97;&#118;&#111;&#105;&#114;&#32;&#117;&#110;&#32;&#97;&#112;&#101;&#114;&ccedil;&#117;&#32;&#100;&#101;&#32;&#108;&#97;&#32;&#112;&#97;&#103;&#101;&#32;&#119;&#101;&#98;&#32;&#58;  &#60;&#105;&#109;&#103;&#32;&#99;&#108;&#97;&#115;&#115;&#61;&#34;&#97;&#108;&#105;&#103;&#110;&#99;&#101;&#110;&#116;&#101;&#114;&#32;&#119;&#112;&#45;&#105;&#109;&#97;&#103;&#101;&#45;&#54;&#56;&#57;&#32;&#115;&#105;&#122;&#101;&#45;&#102;&#117;&#108;&#108;&#34;&#32;&#115;&#114;&#99;&#61;&#34;&#104;&#116;&#116;&#112;&#115;&#58;&#47;&#47;&#119;&#119;&#119;&#46;&#101;&#112;&#104;&#105;&#113;&#117;&#97;&#110;&#116;&#46;&#99;&#111;&#109;&#47;&#119;&#112;&#45;&#99;&#111;&#110;&#116;&#101;&#110;&#116;&#47;&#117;&#112;&#108;&#111;&#97;&#100;&#115;&#47;&#50;&#48;&#49;&#54;&#47;&#49;&#49;&#47;&#116;&#109;&#112;&#83;&#99;&#114;&#101;&#101;&#110;&#83;&#104;&#111;&#116;&#48;&#46;&#112;&#110;&#103;&#34;&#32;&#97;&#108;&#116;&#61;&#34;&#116;&#109;&#112;&#115;&#99;&#114;&#101;&#101;&#110;&#115;&#104;&#111;&#116;&#48;&#34;&#32;&#119;&#105;&#100;&#116;&#104;&#61;&#34;&#49;&#48;&#48;&#52;&#34;&#32;&#104;&#101;&#105;&#103;&#104;&#116;&#61;&#34;&#57;&#56;&#54;&#34;&#32;&#47;&#62;  &#83;&#105;&#32;&#108;&#39;&#111;&#110;&#32;&#111;&#98;&#116;&#105;&#101;&#110;&#116;&#32;&#117;&#110;&#101;&#32;&#105;&#109;&#97;&#103;&#101;&#32;&#115;&#105;&#109;&#105;&#108;&#97;&#105;&#114;&#101;&#44;&#32;&#99;&#39;&#101;&#115;&#116;&#32;&#100;&#105;&#114;&#101;&#32;&#113;&#117;&#101;&#32;&#116;&#111;&#117;&#116;&#32;&#115;&#101;&#32;&#112;&#97;&#115;&#115;&#101;&#32;&#98;&#105;&#101;&#110;&#32;&#33; &#60;&#104;&#51;&#62;&#69;&#116;&#97;&#112;&#101;&#32;&#73;&#73;&#58;&#32;&#73;&#110;&#116;&#101;&#114;&#97;&#99;&#116;&#105;&#111;&#110;&#32;&#97;&#118;&#101;&#99;&#32;&#108;&#101;&#32;&#115;&#105;&#116;&#101;&#32;&#119;&#101;&#98;&#60;&#47;&#104;&#51;&#62; &#80;&#111;&#117;&#114;&#32;&#105;&#110;&#116;&#101;&#114;&#97;&#103;&#105;&#114;&#32;&#97;&#118;&#101;&#99;&#32;&#108;&#101;&#32;&#115;&#105;&#116;&#101;&#32;&#119;&#101;&#98;&#32;&#110;&#111;&#116;&#97;&#109;&#109;&#101;&#110;&#116;&#32;&#101;&#110;&#116;&#114;&#101;&#114;&#32;&#108;&#101;&#32;&#110;&#111;&#109;&#32;&#100;&#101;&#32;&#108;&#97;&#32;&#115;&#111;&#99;&#105;&eacute;&#116;&eacute;&#32;&#100;&#111;&#110;&#116;&#32;&#110;&#111;&#117;&#115;&#32;&#118;&#111;&#117;&#108;&#111;&#110;&#115;&#32;&#111;&#98;&#116;&#101;&#110;&#105;&#114;&#32;&#108;&#39;&#104;&#105;&#115;&#116;&#111;&#114;&#105;&#113;&#117;&#101;&#32;&#100;&#101;&#115;&#32;&#99;&#111;&#117;&#114;&#115;&#44;&#32;&#108;&#97;&#32;&#112;&eacute;&#114;&#105;&#111;&#100;&#101;&#32;&#101;&#116;&#32;&#118;&#97;&#108;&#105;&#100;&#101;&#114;&#32;&#108;&#101;&#32;&#102;&#111;&#114;&#109;&#117;&#108;&#97;&#105;&#114;&#101;&#32;&#110;&#111;&#117;&#115;&#32;&#100;&#101;&#118;&#111;&#110;&#115;&#32;&agrave;&#32;&#99;&#104;&#97;&#113;&#117;&#101;&#32;&#102;&#111;&#105;&#115;&#32;&#114;&eacute;&#102;&eacute;&#114;&#101;&#110;&#99;&#101;&#114;&#32;&#108;&#39;&eacute;&#108;&eacute;&#109;&#101;&#110;&#116;&#32;&#100;&#101;&#32;&#108;&#97;&#32;&#112;&#97;&#103;&#101;&#32;&#119;&#101;&#98;&#46;&#32;&#69;&#120;&#112;&#108;&#105;&#99;&#97;&#116;&#105;&#111;&#110;&#32;&#58;&#32;&#67;&#111;&#110;&#102;&#111;&#114;&#109;&#101;&#109;&#101;&#110;&#116;&#32;&#97;&#117;&#120;&#32;&#115;&#116;&#97;&#110;&#100;&#97;&#114;&#100;&#115;&#32;&#40;&#60;&#97;&#32;&#104;&#114;&#101;&#102;&#61;&#34;&#104;&#116;&#116;&#112;&#115;&#58;&#47;&#47;&#102;&#114;&#46;&#119;&#105;&#107;&#105;&#112;&#101;&#100;&#105;&#97;&#46;&#111;&#114;&#103;&#47;&#119;&#105;&#107;&#105;&#47;&#68;&#111;&#99;&#117;&#109;&#101;&#110;&#116;&#95;&#79;&#98;&#106;&#101;&#99;&#116;&#95;&#77;&#111;&#100;&#101;&#108;&#34;&#62;&#68;&#79;&#77;&#60;&#47;&#97;&#62;&#41;&#44;&#32;&#100;&#97;&#110;&#115;&#32;&#117;&#110;&#101;&#32;&#112;&#97;&#103;&#101;&#32;&#72;&#84;&#77;&#76;&#32;&#112;&#97;&#114;&#32;&#101;&#120;&#101;&#109;&#112;&#108;&#101;&#44;&#32;&#111;&#110;&#32;&#112;&#101;&#117;&#116;&#32;&#105;&#110;&#116;&#101;&#114;&#97;&#103;&#105;&#114;&#32;&#97;&#118;&#101;&#99;&#32;&#115;&#101;&#115;&#32;&#99;&#111;&#109;&#112;&#111;&#115;&#97;&#110;&#116;&#115;&#32;&agrave;&#32;&#116;&#114;&#97;&#118;&#101;&#114;&#115;&#32;&#117;&#110;&#32;&#110;&#111;&#109;&#44;&#32;&#117;&#110;&#32;&#105;&#100;&#32;&#111;&#117;&#32;&#101;&#110;&#99;&#111;&#114;&#101;&#32;&agrave;&#32;&#116;&#114;&#97;&#118;&#101;&#114;&#115;&#32;&#117;&#110;&#32;&#115;&#101;&#108;&#101;&#99;&#116;&#101;&#117;&#114;&#32;&#100;&#101;&#32;&#115;&#116;&#121;&#108;&#101;&#32;&#67;&#83;&#83;&#46;&#32;&#32;&#86;&#111;&#121;&#111;&#110;&#115;&#32;&#112;&#108;&#117;&#116;&ocirc;&#116;&#32;&#58;  &#78;&#111;&#117;&#115;&#32;&#97;&#108;&#108;&#111;&#110;&#115;&#32;&#115;&eacute;&#108;&eacute;&#99;&#116;&#105;&#111;&#110;&#110;&#101;&#114;&#32;&#108;&#101;&#32;&#110;&#111;&#109;&#32;&#100;&#101;&#32;&#108;&#97;&#32;&#115;&#111;&#99;&#105;&eacute;&#116;&eacute;&#32;&#100;&#111;&#110;&#116;&#32;&#110;&#111;&#117;&#115;&#32;&#118;&#111;&#117;&#108;&#111;&#110;&#115;&#32;&#111;&#98;&#116;&#101;&#110;&#105;&#114;&#32;&#108;&#39;&#104;&#105;&#115;&#116;&#111;&#114;&#105;&#113;&#117;&#101;&#32;&#100;&#97;&#110;&#115;&#32;&#108;&#97;&#32;&#108;&#105;&#115;&#116;&#101;&#32;&#100;&eacute;&#114;&#111;&#117;&#108;&#97;&#110;&#116;&#101;&#32;&#40;&#118;&#111;&#105;&#114;&#32;&#108;&#39;&#105;&#109;&#97;&#103;&#101;&#32;&#99;&#105;&#45;&#100;&#101;&#115;&#115;&#117;&#115;&#41;&#32;&#112;&#111;&#117;&#114;&#32;&#99;&#101;&#108;&agrave;&#32;&#110;&#111;&#117;&#115;&#32;&#97;&#108;&#108;&#111;&#110;&#115;&#32;&#100;&#101;&#118;&#111;&#110;&#115;&#32;&#102;&#111;&#117;&#114;&#110;&#105;&#114;&#32;&#108;&#39;&#105;&#100;&#32;&#100;&#101;&#32;&#108;&#39;&#111;&#98;&#106;&#101;&#116;&#32;&#108;&#105;&#115;&#116;&#101;&#32;&#100;&eacute;&#114;&#111;&#117;&#108;&#97;&#110;&#116;&#101;&#32;&agrave;&#32;&#108;&#97;&#32;&#102;&#111;&#110;&#99;&#116;&#105;&#111;&#110;&#32;&#60;&#115;&#112;&#97;&#110;&#32;&#115;&#116;&#121;&#108;&#101;&#61;&#34;&#99;&#111;&#108;&#111;&#114;&#58;&#32;&#35;&#48;&#48;&#48;&#48;&#102;&#102;&#59;&#34;&#62;&#102;&#105;&#110;&#100;&#69;&#108;&#101;&#109;&#101;&#110;&#116;&#40;&#41;&#60;&#47;&#115;&#112;&#97;&#110;&#62;&#46;&#32;&#80;&#111;&#117;&#114;&#32;&#111;&#98;&#116;&#101;&#110;&#105;&#114;&#32;&#108;&#39;&#105;&#100;&#32;&#105;&#108;&#32;&#115;&#117;&#102;&#102;&#105;&#116;&#32;&#100;&#101;&#32;&#99;&#108;&#105;&#113;&#117;&#101;&#114;&#32;&#100;&#114;&#111;&#105;&#116;&#32;&#115;&#117;&#114;&#32;&#108;&#97;&#32;&#108;&#105;&#115;&#116;&#101;&#32;&#100;&eacute;&#114;&#111;&#117;&#108;&#97;&#110;&#116;&#101;&#32;&#101;&#116;&#32;&#101;&#110;&#115;&#117;&#105;&#116;&#101;&#32;&#100;&#101;&#32;&#99;&#104;&#111;&#105;&#115;&#105;&#114;&#32;&#105;&#110;&#115;&#112;&#101;&#99;&#116;&#101;&#114;&#32;&#108;&#39;&eacute;&#108;&eacute;&#109;&#101;&#110;&#116;&#44;&#32;&#117;&#110;&#101;&#32;&#102;&eacute;&#110;&ecirc;&#116;&#114;&#101;&#32;&#115;&#39;&#111;&#117;&#118;&#114;&#105;&#114;&#97;&#32;&agrave;&#32;&#99;&ocirc;&#116;&eacute;&#32;&#97;&#118;&#101;&#99;&#32;&#108;&#101;&#32;&#99;&#111;&#100;&#101;&#32;&#115;&#111;&#117;&#114;&#99;&#101;&#32;&#100;&#101;&#32;&#108;&#39;&eacute;&#108;&eacute;&#109;&#101;&#110;&#116;&#32;&#100;&#111;&#110;&#116;&#32;&#118;&#111;&#105;&#99;&#105;&#32;&#108;&#39;&#101;&#120;&#116;&#114;&#97;&#105;&#116;&#58; &#60;&#112;&#114;&#101;&#32;&#99;&#108;&#97;&#115;&#115;&#61;&#34;&#108;&#97;&#110;&#103;&#58;&#120;&#104;&#116;&#109;&#108;&#32;&#100;&#101;&#99;&#111;&#100;&#101;&#58;&#116;&#114;&#117;&#101;&#34;&#62;&#60;&#115;&#101;&#108;&#101;&#99;&#116;&#32;&#110;&#97;&#109;&#101;&#61;&#34;&#72;&#105;&#115;&#116;&#111;&#114;&#105;&#113;&#117;&#101;&#78;&#101;&#103;&#111;&#99;&#105;&#97;&#116;&#105;&#111;&#110;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"679\" width=\"1202\" style=\"vertical-align: -4px;\"\/>HistValeur1<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ephiquant.com\/wp-content\/ql-cache\/quicklatex.com-bbbd21bdf8e951bdfd0a100931f03f0f_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#68;&#68;&#86;&#97;&#108;&#101;&#117;&#114;&#34;&#32;&#105;&#100;&#61;&#34;&#72;&#105;&#115;&#116;&#111;&#114;&#105;&#113;&#117;&#101;&#78;&#101;&#103;&#111;&#99;&#105;&#97;&#116;&#105;&#111;&#110;&#49;&#95;&#72;&#105;&#115;&#116;&#86;&#97;&#108;&#101;&#117;&#114;&#49;&#95;&#68;&#68;&#86;&#97;&#108;&#101;&#117;&#114;&#34;&#32;&#99;&#108;&#97;&#115;&#115;&#61;&#34;&#105;&#110;&#112;&#117;&#116;&#34;&#32;&#115;&#116;&#121;&#108;&#101;&#61;&#34;&#119;&#105;&#100;&#116;&#104;&#58;&#50;&#53;&#54;&#112;&#120;&#59;&#34;&#62; \t\t&#60;&#111;&#112;&#116;&#105;&#111;&#110;&#32;&#115;&#101;&#108;&#101;&#99;&#116;&#101;&#100;&#61;&#34;&#115;&#101;&#108;&#101;&#99;&#116;&#101;&#100;&#34;&#32;&#118;&#97;&#108;&#117;&#101;&#61;&#34;&#34;&#62;&#67;&#104;&#111;&#105;&#115;&#105;&#115;&#115;&#101;&#122;&#32;&#117;&#110;&#101;&#32;&#118;&#97;&#108;&#101;&#117;&#114;&#60;&#47;&#111;&#112;&#116;&#105;&#111;&#110;&#62; \t\t&#60;&#111;&#112;&#116;&#105;&#111;&#110;&#32;&#118;&#97;&#108;&#117;&#101;&#61;&#34;&#57;&#48;&#48;&#48;&#32;&#32;&#34;&#62;&#68;&#79;&#85;&#74;&#65;&#32;&#80;&#82;&#79;&#77;&#32;&#65;&#68;&#68;&#79;&#72;&#65;&#60;&#47;&#111;&#112;&#116;&#105;&#111;&#110;&#62; \t&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#60;&#111;&#112;&#116;&#105;&#111;&#110;&#32;&#118;&#97;&#108;&#117;&#101;&#61;&#34;&#49;&#49;&#50;&#48;&#48;&#32;&#34;&#62;&#65;&#76;&#76;&#73;&#65;&#78;&#67;&#69;&#83;&#60;&#47;&#111;&#112;&#116;&#105;&#111;&#110;&#62; \t\t&#60;&#111;&#112;&#116;&#105;&#111;&#110;&#32;&#118;&#97;&#108;&#117;&#101;&#61;&#34;&#49;&#49;&#55;&#48;&#48;&#32;&#34;&#62;&#65;&#70;&#82;&#73;&#67;&#32;&#73;&#78;&#68;&#85;&#83;&#84;&#82;&#73;&#69;&#83;&#32;&#83;&#65;&#60;&#47;&#111;&#112;&#116;&#105;&#111;&#110;&#62; &#60;&#47;&#115;&#101;&#108;&#101;&#99;&#116;&#62;&#60;&#47;&#112;&#114;&#101;&#62; &#79;&#110;&#32;&#118;&#111;&#105;&#116;&#32;&#108;&#101;&#32;&#110;&#111;&#109;&#32;&#101;&#116;&#32;&#108;&#39;&#105;&#100;&#44;&#32;&#110;&#111;&#117;&#115;&#32;&#112;&#114;&#101;&#110;&#100;&#114;&#111;&#110;&#115;&#32;&#108;&#39;&#105;&#100;&#32;&#113;&#117;&#105;&#32;&#118;&#97;&#117;&#116;&#32;&#34;&#60;&#115;&#112;&#97;&#110;&#32;&#115;&#116;&#121;&#108;&#101;&#61;&#34;&#99;&#111;&#108;&#111;&#114;&#58;&#32;&#35;&#57;&#57;&#51;&#51;&#48;&#48;&#59;&#34;&#62;&#72;&#105;&#115;&#116;&#111;&#114;&#105;&#113;&#117;&#101;&#78;&#101;&#103;&#111;&#99;&#105;&#97;&#116;&#105;&#111;&#110;&#49;&#95;&#72;&#105;&#115;&#116;&#86;&#97;&#108;&#101;&#117;&#114;&#49;&#95;&#68;&#68;&#86;&#97;&#108;&#101;&#117;&#114;&#60;&#47;&#115;&#112;&#97;&#110;&#62;&#34;&#32;&#113;&#117;&#39;&#105;&#108;&#32;&#102;&#97;&#117;&#116;&#32;&#112;&#97;&#115;&#115;&#101;&#114;&#32;&#100;&#97;&#110;&#115;&#32;&#108;&#97;&#32;&#102;&#111;&#110;&#99;&#116;&#105;&#111;&#110;&#32;&#60;&#115;&#112;&#97;&#110;&#32;&#115;&#116;&#121;&#108;&#101;&#61;&#34;&#99;&#111;&#108;&#111;&#114;&#58;&#32;&#35;&#48;&#48;&#48;&#48;&#102;&#102;&#59;&#34;&#62;&#102;&#105;&#110;&#100;&#69;&#108;&#101;&#109;&#101;&#110;&#116;&#40;&#41;&#60;&#47;&#115;&#112;&#97;&#110;&#62;&#32;&#99;&#111;&#109;&#109;&#101;&#32;&#99;&#101;&#99;&#105;&#58; &#60;&#112;&#114;&#101;&#32;&#99;&#108;&#97;&#115;&#115;&#61;&#34;&#108;&#97;&#110;&#103;&#58;&#114;&#32;&#100;&#101;&#99;&#111;&#100;&#101;&#58;&#116;&#114;&#117;&#101;&#34;&#62;&#99;&#111;&#109;&#98;&#111;&#69;&#108;&#109;&#32;&#60;&#45;&#32;&#114;&#101;&#109;&#68;&#114;\" title=\"Rendered by QuickLaTeX.com\" height=\"234\" width=\"585\" style=\"vertical-align: -2px;\"\/>findElement(using = 'id',\r\n                        value='HistoriqueNegociation1_HistValeur1_DDValeur')\r\n comboElm<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ephiquant.com\/wp-content\/ql-cache\/quicklatex.com-36767c6ddceeba2db420bd4956359094_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#115;&#101;&#110;&#100;&#75;&#101;&#121;&#115;&#84;&#111;&#69;&#108;&#101;&#109;&#101;&#110;&#116;&#40;&#108;&#105;&#115;&#116;&#40;&#39;&#65;&#76;&#76;&#73;&#39;&#41;&#41; &#32;&#114;&#101;&#109;&#68;&#114;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"334\" style=\"vertical-align: -4px;\"\/>screenshot(display = TRUE) # obtenir un aper\u00e7u<\/pre>\n<p>Une fois l&#8217;\u00e9l\u00e9ment liste d\u00e9roulante retrouver, il reste \u00e0 lui envoyer le nom de la soci\u00e9t\u00e9 &#8220;ALLIANCE&#8221; (abr\u00e9g\u00e9 &#8220;ALLI&#8221;\u00a0par ce que c&#8217;est une liste d\u00e9roulante les premi\u00e8res lettres suffisent pour faire la s\u00e9lection mais il faudrait s&#8217;assurer qu&#8217;aucun autre nom ne commence pas par &#8220;ALLI&#8221; sinon il faudrait \u00e9crire le nom en toute lettre) \u00e0 travers la fonction\u00a0<span style=\"color: #0000ff;\">sendKeysToElement(). <\/span>En aper\u00e7u nous avons :<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-691 size-full\" src=\"https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/tmpScreenShot1.png\" alt=\"tmpscreenshot1\" width=\"864\" height=\"355\" srcset=\"https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/tmpScreenShot1.png 864w, https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/tmpScreenShot1-300x123.png 300w, https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/tmpScreenShot1-768x316.png 768w\" sizes=\"auto, (max-width: 864px) 100vw, 864px\" \/><\/p>\n<p>Maintenant que l&#8217;on a compris le principe, on peut r\u00e9it\u00e9rer le processus aux autres \u00e9l\u00e9ments. Ici, au lieu sp\u00e9cifier directement la p\u00e9riode de l&#8217;historique dont nous avons besoin(option 1 en rouge) nous allons exploiter la limitation des donn\u00e9es \u00e0 un historique de 3 ans seulement en notre faveur. Nous allons donc choisir de t\u00e9l\u00e9charger les donnes sur 3 ans(voir illustration pas trop top ci-dessous) :<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-693 size-full\" src=\"https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/tmpScreenShot2.png\" alt=\"tmpscreenshot2\" width=\"832\" height=\"339\" srcset=\"https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/tmpScreenShot2.png 832w, https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/tmpScreenShot2-300x122.png 300w, https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/tmpScreenShot2-768x313.png 768w\" sizes=\"auto, (max-width: 832px) 100vw, 832px\" \/><\/p>\n<p>Nous allons d&#8217;abord chercher les id respectifs du bouton radio &#8220;Par mensualit\u00e9&#8221;, de la liste d\u00e9roulante et du bouton &#8220;Valider&#8221;. Ensuite nous cliquer sur le bouton radio et s\u00e9lectionner &#8220;3 ans&#8221; dans la liste d\u00e9roulante \u00e0 droite et en fin valider en envoyant la commande de la touche &#8220;Entrer&#8221; au bouton &#8220;valider&#8221;( un peu comme quand l&#8217;on fini de remplir un formulaire on tape &#8220;Entrer&#8221; pour valider le tout) :<\/p>\n<pre class=\"lang:r decode:true \">radioElm &lt;- remDr<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ephiquant.com\/wp-content\/ql-cache\/quicklatex.com-5fb66f1b6758fe27d83e7e7c12dce545_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#102;&#105;&#110;&#100;&#69;&#108;&#101;&#109;&#101;&#110;&#116;&#40;&#117;&#115;&#105;&#110;&#103;&#32;&#61;&#32;&#39;&#105;&#100;&#39;&#44; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#118;&#97;&#108;&#117;&#101;&#32;&#61;&#32;&#39;&#72;&#105;&#115;&#116;&#111;&#114;&#105;&#113;&#117;&#101;&#78;&#101;&#103;&#111;&#99;&#105;&#97;&#116;&#105;&#111;&#110;&#49;&#95;&#72;&#105;&#115;&#116;&#86;&#97;&#108;&#101;&#117;&#114;&#49;&#95;&#82;&#66;&#83;&#101;&#97;&#114;&#99;&#104;&#68;&#97;&#116;&#101;&#39;&#41; &#114;&#97;&#100;&#105;&#111;&#69;&#108;&#109;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"784\" style=\"vertical-align: -4px;\"\/>click()\r\ncomoElmdate &lt;- remDr<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ephiquant.com\/wp-content\/ql-cache\/quicklatex.com-850a2e1f857b9e5bb509e8d31c93ac1e_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#102;&#105;&#110;&#100;&#69;&#108;&#101;&#109;&#101;&#110;&#116;&#40;&#117;&#115;&#105;&#110;&#103;&#32;&#61;&#32;&#39;&#105;&#100;&#39;&#32;&#44; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#118;&#97;&#108;&#117;&#101;&#32;&#61;&#32;&#39;&#72;&#105;&#115;&#116;&#111;&#114;&#105;&#113;&#117;&#101;&#78;&#101;&#103;&#111;&#99;&#105;&#97;&#116;&#105;&#111;&#110;&#49;&#95;&#72;&#105;&#115;&#116;&#86;&#97;&#108;&#101;&#117;&#114;&#49;&#95;&#68;&#68;&#117;&#114;&#101;&#101;&#39;&#41; &#99;&#111;&#109;&#111;&#69;&#108;&#109;&#100;&#97;&#116;&#101;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"758\" style=\"vertical-align: -4px;\"\/>sendKeysToElement(list('3 ans'))\r\nsubmitbn &lt;- remDr<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ephiquant.com\/wp-content\/ql-cache\/quicklatex.com-4bac876e9a0c521a833d1cdb2849bc97_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#102;&#105;&#110;&#100;&#69;&#108;&#101;&#109;&#101;&#110;&#116;&#40;&#117;&#115;&#105;&#110;&#103;&#32;&#61;&#32;&#39;&#105;&#100;&#39;&#44; &#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#118;&#97;&#108;&#117;&#101;&#32;&#61;&#32;&#39;&#72;&#105;&#115;&#116;&#111;&#114;&#105;&#113;&#117;&#101;&#78;&#101;&#103;&#111;&#99;&#105;&#97;&#116;&#105;&#111;&#110;&#49;&#95;&#72;&#105;&#115;&#116;&#86;&#97;&#108;&#101;&#117;&#114;&#49;&#95;&#73;&#109;&#97;&#103;&#101;&#49;&#39;&#41; &#115;&#117;&#98;&#109;&#105;&#116;&#98;&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"719\" style=\"vertical-align: -4px;\"\/>sendKeysToElement(list(key = 'enter'))\r\nremDr<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ephiquant.com\/wp-content\/ql-cache\/quicklatex.com-1c0777be4b869c6269bc837311d00d60_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#115;&#99;&#114;&#101;&#101;&#110;&#115;&#104;&#111;&#116;&#40;&#100;&#105;&#115;&#112;&#108;&#97;&#121;&#32;&#61;&#32;&#84;&#82;&#85;&#69;&#41;&#60;&#47;&#112;&#114;&#101;&#62; &#83;&#105;&#32;&#116;&#111;&#117;&#116;&#32;&#115;&#101;&#32;&#112;&#97;&#115;&#115;&#101;&#32;&#98;&#105;&#101;&#110;&#32;&#110;&#111;&#117;&#115;&#32;&#97;&#108;&#108;&#111;&#110;&#115;&#32;&#118;&#111;&#105;&#114;&#32;&#97;&#102;&#102;&#105;&#99;&#104;&#101;&#114;&#32;&#99;&#101;&#32;&#113;&#117;&#105;&#32;&#115;&#117;&#105;&#116;&#32;&#40;&#105;&#108;&#32;&#102;&#97;&#117;&#100;&#114;&#97;&#105;&#116;&#32;&#97;&#118;&#111;&#105;&#114;&#32;&#117;&#110;&#101;&#32;&#98;&#111;&#110;&#110;&#101;&#32;&#99;&#111;&#110;&#110;&#101;&#99;&#116;&#105;&#118;&#105;&#116;&eacute;&#32;&#111;&ugrave;&#32;&#108;&#97;&#105;&#115;&#115;&#101;&#114;&#32;&#115;&#39;&eacute;&#99;&#111;&#117;&#108;&#101;&#114;&#32;&#113;&#117;&#101;&#108;&#113;&#117;&#101;&#115;&#32;&#102;&#114;&#97;&#99;&#116;&#105;&#111;&#110;&#115;&#32;&#100;&#101;&#32;&#115;&#101;&#99;&#111;&#110;&#100;&#101;&#115;&#32;&#112;&#111;&#117;&#114;&#32;&#108;&#97;&#110;&#99;&#101;&#114;&#32;&#108;&#97;&#32;&#100;&#101;&#114;&#110;&#105;&egrave;&#114;&#101;&#32;&#99;&#111;&#109;&#109;&#97;&#110;&#100;&#101;&#32;&#115;&#105;&#110;&#111;&#110;&#32;&#111;&#110;&#32;&#97;&#117;&#114;&#97;&#32;&#117;&#110;&#101;&#32;&#105;&#109;&#97;&#103;&#101;&#32;&#100;&#101;&#32;&#112;&#97;&#103;&#101;&#32;&#101;&#110;&#32;&#99;&#104;&#97;&#114;&#103;&#101;&#109;&#101;&#110;&#116;&#32;&#101;&#116;&#32;&#112;&#97;&#114;&#32;&#97;&#105;&#73;&#108;&#101;&#117;&#114;&#115;&#44;&#32;&#105;&#108;&#32;&#118;&#97;&#32;&#102;&#97;&#108;&#108;&#111;&#105;&#114;&#32;&#122;&#111;&#111;&#109;&#101;&#114;&#32;&#112;&#111;&#117;&#114;&#32;&#98;&#105;&#101;&#110;&#32;&#118;&#111;&#105;&#114;&#32;&#99;&#111;&#109;&#109;&#101;&#32;&#99;&#105;&#45;&#100;&#101;&#115;&#115;&#111;&#117;&#115;&#41;&#32;&#58;  &#60;&#105;&#109;&#103;&#32;&#99;&#108;&#97;&#115;&#115;&#61;&#34;&#97;&#108;&#105;&#103;&#110;&#110;&#111;&#110;&#101;&#32;&#119;&#112;&#45;&#105;&#109;&#97;&#103;&#101;&#45;&#54;&#57;&#54;&#32;&#115;&#105;&#122;&#101;&#45;&#102;&#117;&#108;&#108;&#34;&#32;&#115;&#114;&#99;&#61;&#34;&#104;&#116;&#116;&#112;&#115;&#58;&#47;&#47;&#119;&#119;&#119;&#46;&#101;&#112;&#104;&#105;&#113;&#117;&#97;&#110;&#116;&#46;&#99;&#111;&#109;&#47;&#119;&#112;&#45;&#99;&#111;&#110;&#116;&#101;&#110;&#116;&#47;&#117;&#112;&#108;&#111;&#97;&#100;&#115;&#47;&#50;&#48;&#49;&#54;&#47;&#49;&#49;&#47;&#116;&#109;&#112;&#83;&#99;&#114;&#101;&#101;&#110;&#83;&#104;&#111;&#116;&#51;&#45;&#49;&#46;&#112;&#110;&#103;&#34;&#32;&#97;&#108;&#116;&#61;&#34;&#116;&#109;&#112;&#115;&#99;&#114;&#101;&#101;&#110;&#115;&#104;&#111;&#116;&#51;&#34;&#32;&#119;&#105;&#100;&#116;&#104;&#61;&#34;&#49;&#48;&#48;&#53;&#34;&#32;&#104;&#101;&#105;&#103;&#104;&#116;&#61;&#34;&#53;&#54;&#54;&#34;&#32;&#47;&#62; &#60;&#104;&#51;&#62;&#69;&#116;&#97;&#112;&#101;&#32;&#73;&#73;&#73;&#58;&#32;&#80;&#97;&#114;&#115;&#97;&#103;&#101;&#32;&#100;&#101;&#32;&#108;&#97;&#32;&#112;&#97;&#103;&#101;&#32;&#119;&#101;&#98;&#32;&#97;&#118;&#101;&#99;&#32;&#60;&#115;&#112;&#97;&#110;&#32;&#115;&#116;&#121;&#108;&#101;&#61;&#34;&#99;&#111;&#108;&#111;&#114;&#58;&#32;&#35;&#48;&#48;&#48;&#48;&#102;&#102;&#59;&#34;&#62;&#88;&#77;&#76;&#60;&#47;&#115;&#112;&#97;&#110;&#62;&#32;&#101;&#116;&#32;&#102;&#111;&#114;&#109;&#97;&#116;&#97;&#103;&#101;&#32;&#100;&#101;&#115;&#32;&#100;&#111;&#110;&#110;&eacute;&#101;&#115;&#32;&#101;&#110;&#32;&#60;&#115;&#112;&#97;&#110;&#32;&#115;&#116;&#121;&#108;&#101;&#61;&#34;&#99;&#111;&#108;&#111;&#114;&#58;&#32;&#35;&#48;&#48;&#48;&#48;&#102;&#102;&#59;&#34;&#62;&#100;&#97;&#116;&#97;&#46;&#102;&#114;&#97;&#109;&#101;&#60;&#47;&#115;&#112;&#97;&#110;&#62;&#60;&#47;&#104;&#51;&#62; &#77;&#97;&#105;&#110;&#116;&#101;&#110;&#97;&#110;&#116;&#44;&#32;&#78;&#111;&#117;&#115;&#32;&#97;&#108;&#108;&#111;&#110;&#115;&#44;&#32;&#100;&#39;&#97;&#98;&#111;&#114;&#100;&#32;&#111;&#98;&#116;&#101;&#110;&#105;&#114;&#32;&#108;&#101;&#32;&#99;&#111;&#100;&#101;&#32;&#115;&#111;&#117;&#114;&#99;&#101;&#32;&#100;&#101;&#32;&#108;&#97;&#32;&#112;&#97;&#103;&#101;&#32;&#113;&#117;&#101;&#32;&#110;&#111;&#117;&#115;&#32;&#97;&#118;&#111;&#110;&#115;&#32;&#112;&#114;&eacute;&#99;&eacute;&#100;&#101;&#109;&#109;&#101;&#110;&#116;&#32;&#111;&#98;&#116;&#101;&#110;&#117;&#101;&#46;&#32;&#78;&#111;&#117;&#115;&#32;&#97;&#108;&#108;&#111;&#110;&#115;&#32;&#101;&#110;&#115;&#117;&#105;&#116;&#101;&#32;&#108;&#101;&#32;&#112;&#97;&#114;&#115;&#101;&#114;&#32;&#97;&#118;&#101;&#99;&#32;&#108;&#97;&#32;&#102;&#111;&#110;&#99;&#116;&#105;&#111;&#110;&#32;&#60;&#115;&#112;&#97;&#110;&#32;&#115;&#116;&#121;&#108;&#101;&#61;&#34;&#99;&#111;&#108;&#111;&#114;&#58;&#32;&#35;&#48;&#48;&#48;&#48;&#102;&#102;&#59;&#34;&#62;&#104;&#116;&#109;&#108;&#80;&#97;&#114;&#115;&#101;&#40;&#41;&#60;&#47;&#115;&#112;&#97;&#110;&#62;&#32;&#118;&#101;&#114;&#115;&#32;&#117;&#110;&#32;&#116;&#121;&#112;&#101;&#32;&#100;&#101;&#32;&#100;&#111;&#99;&#117;&#109;&#101;&#110;&#116;&#32;&#111;&#98;&#106;&#101;&#116;&#32;&#82;&#44;&#32;&#104;&#121;&#98;&#114;&#105;&#100;&#101;&#40;&#99;&#97;&#114;&#32;&#104;&eacute;&#114;&#105;&#116;&#97;&#110;&#116;&#32;&agrave;&#32;&#108;&#97;&#32;&#102;&#111;&#105;&#115;&#32;&#100;&#101;&#115;&#32;&#111;&#98;&#106;&#101;&#116;&#115;&#32;&#60;&#115;&#112;&#97;&#110;&#32;&#99;&#108;&#97;&#115;&#115;&#61;&#34;&#108;&#97;&#110;&#103;&#58;&#114;&#32;&#100;&#101;&#99;&#111;&#100;&#101;&#58;&#116;&#114;&#117;&#101;&#32;&#99;&#114;&#97;&#121;&#111;&#110;&#45;&#105;&#110;&#108;&#105;&#110;&#101;&#34;&#62;&#34;&#72;&#84;&#77;&#76;&#73;&#110;&#116;&#101;&#114;&#110;&#97;&#108;&#68;&#111;&#99;&#117;&#109;&#101;&#110;&#116;&#34;&#32;&#34;&#88;&#77;&#76;&#73;&#110;&#116;&#101;&#114;&#110;&#97;&#108;&#68;&#111;&#99;&#117;&#109;&#101;&#110;&#116;&#34;&#32;&#32;&#34;&#88;&#77;&#76;&#65;&#98;&#115;&#116;&#114;&#97;&#99;&#116;&#68;&#111;&#99;&#117;&#109;&#101;&#110;&#116;&#34;&#60;&#47;&#115;&#112;&#97;&#110;&#62;&#32;&#41;&#32;&#99;&#111;&#109;&#112;&#97;&#116;&#105;&#98;&#108;&#101;&#32;&#97;&#117;&#32;&#102;&#111;&#114;&#109;&#97;&#116;&#32;&#88;&#77;&#76;&#32;&#101;&#116;&#32;&#100;&#111;&#110;&#116;&#32;&#111;&#110;&#32;&#112;&#101;&#117;&#116;&#32;&#115;&#99;&#114;&#117;&#116;&#101;&#114;&#32;&#108;&#101;&#115;&#32;&#110;&oelig;&#117;&#100;&#115;&#32;&#97;&#118;&#101;&#99;&#32;&#108;&#97;&#32;&#115;&#121;&#110;&#116;&#97;&#120;&#101;&#32;&#60;&#115;&#116;&#114;&#111;&#110;&#103;&#62;&#88;&#80;&#97;&#116;&#104;&#60;&#47;&#115;&#116;&#114;&#111;&#110;&#103;&#62;&#40;&#60;&#97;&#32;&#104;&#114;&#101;&#102;&#61;&#34;&#104;&#116;&#116;&#112;&#115;&#58;&#47;&#47;&#102;&#114;&#46;&#119;&#105;&#107;&#105;&#112;&#101;&#100;&#105;&#97;&#46;&#111;&#114;&#103;&#47;&#119;&#105;&#107;&#105;&#47;&#88;&#80;&#97;&#116;&#104;&#34;&#62;&#99;&#39;&#101;&#115;&#116;&#32;&#117;&#110;&#32;&#108;&#97;&#110;&#103;&#97;&#103;&#101;&#32;&#40;&#110;&#111;&#110;&#32;&#88;&#77;&#76;&#41;&#32;&#112;&#111;&#117;&#114;&#32;&#108;&#111;&#99;&#97;&#108;&#105;&#115;&#101;&#114;&#32;&#117;&#110;&#101;&#32;&#112;&#111;&#114;&#116;&#105;&#111;&#110;&#32;&#100;&#39;&#117;&#110;&#32;&#100;&#111;&#99;&#117;&#109;&#101;&#110;&#116;&#32;&#88;&#77;&#76;&#41;&#60;&#47;&#97;&#62;&#46; &#60;&#112;&#114;&#101;&#32;&#99;&#108;&#97;&#115;&#115;&#61;&#34;&#108;&#97;&#110;&#103;&#58;&#114;&#32;&#100;&#101;&#99;&#111;&#100;&#101;&#58;&#116;&#114;&#117;&#101;&#34;&#62;&#112;&#97;&#103;&#101;&#32;&#60;&#45;&#32;&#114;&#101;&#109;&#68;&#114;\" title=\"Rendered by QuickLaTeX.com\" height=\"414\" width=\"2119\" style=\"vertical-align: -4px;\"\/>getPageSource()\r\nrequire(XML)\r\ndoc &lt;-htmlParse(unlist(page))\r\nnode &lt;- getNodeSet(doc, path = '\/\/*[@id=\"arial11bleu\"]')<\/pre>\n<p>Nous allons d&#8217;abord retrouver la syntaxe XPath(chemin de localisation) du tableau en cliquant droit sur ce dernier et ensuite sur son code source (voir image ci-dessous) on copie le XPath (encercl\u00e9 en rouge).C&#8217;est avec ce chemin de localisation de notre tableau que nous allons extraire le table de la page enti\u00e8re. Heureusement ce chemin ne change pas( \u00e0 moins ce que le site soit compl\u00e8tement refait). Ce chemin est ensuite pass\u00e9 \u00e0 la fonction <span style=\"color: #0000ff;\">getNodeSet()<\/span> qui extrait un n\u0153ud d&#8217;une page XML<a href=\"https:\/\/fr.wikipedia.org\/wiki\/Extensible_Markup_Language\">(D&#8217;un point de vue formel, un document XML est un arbre, articulant diff\u00e9rents types de n\u0153uds (texte, \u00e9l\u00e9ments, attributs, commentaires\u2026))<\/a>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-699 size-full\" src=\"https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/tmpScreenShot4.png\" alt=\"tmpscreenshot4\" width=\"1366\" height=\"768\" srcset=\"https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/tmpScreenShot4.png 1366w, https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/tmpScreenShot4-300x169.png 300w, https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/tmpScreenShot4-768x432.png 768w, https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/tmpScreenShot4-1024x576.png 1024w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/p>\n<p>Nous avons r\u00e9duit la page \u00e0 son n\u0153ud o\u00f9 se trouve le tableau, maintenant, nous allons extraire notre tableau vers un objet data.frame. Mais d&#8217;abord voyons le structure de l&#8217;objet <strong>node :<\/strong><\/p>\n<pre class=\"lang:r decode:true \">&gt; str(node)\r\nList of 3\r\n <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ephiquant.com\/wp-content\/ql-cache\/quicklatex.com-575108696796ee9da63df5cd7d7ddbf3_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#58;&#67;&#108;&#97;&#115;&#115;&#101;&#115;&#32;&#39;&#88;&#77;&#76;&#73;&#110;&#116;&#101;&#114;&#110;&#97;&#108;&#69;&#108;&#101;&#109;&#101;&#110;&#116;&#78;&#111;&#100;&#101;&#39;&#44;&#32;&#39;&#88;&#77;&#76;&#73;&#110;&#116;&#101;&#114;&#110;&#97;&#108;&#78;&#111;&#100;&#101;&#39;&#44;&#32;&#39;&#88;&#77;&#76;&#65;&#98;&#115;&#116;&#114;&#97;&#99;&#116;&#78;&#111;&#100;&#101;&#39;&#32;&#60;&#101;&#120;&#116;&#101;&#114;&#110;&#97;&#108;&#112;&#116;&#114;&#62;\" title=\"Rendered by QuickLaTeX.com\" height=\"40\" width=\"675\" style=\"vertical-align: -4px;\"\/> :Classes 'XMLInternalElementNode', 'XMLInternalNode', 'XMLAbstractNode' &lt;externalptr&gt; \r\n $ :Classes 'XMLInternalElementNode', 'XMLInternalNode', 'XMLAbstractNode' &lt;externalptr&gt; \r\n - attr(*, \"class\")= chr \"XMLNodeSet\"<\/pre>\n<p>On voit bien que c&#8217;est une liste et notre tableau est contenu dans le dernier \u00e9l\u00e9ment du tableau 3(en effet en affichant un par un chaque \u00e9l\u00e9ment du tableau vous verrez que les 2 premiers sont les ent\u00eates qui pr\u00e9c\u00e8dent le tableau). L\u2019extraction du tableau vers le <span style=\"color: #0000ff;\">data.frame<\/span>\u00a0passe par la fonction <span style=\"color: #0000ff;\">readHTMLTable()<\/span>:<\/p>\n<pre class=\"lang:r decode:true \">&gt; raw_data.frame &lt;- readHTMLTable(node[[3]], stringsAsFactor = F)\r\n&gt; raw_data.frame\r\n    V1           V2 V3                V4 V5            V6 V7            V8 V9             V10 V11           V12\r\n1                                                                                                              \r\n2      S\u00c3&lt;83&gt;\u00c2\u00a9ance    D\u00c3&lt;83&gt;\u00c2\u00a9signation    Premier Cours    Dernier Cours    + haut du jours     + bas du jour\r\n3                                                                                                              \r\n4        16\/11\/2016            ALLIANCES            88,42            87,50              89,00             86,50\r\n5        15\/11\/2016            ALLIANCES            90,00            89,10              90,00             88,00\r\n6        14\/11\/2016            ALLIANCES            90,20            90,00              92,00             90,00\r\n7        11\/11\/2016            ALLIANCES            90,24            90,00              90,50             89,00\r\n8        10\/11\/2016            ALLIANCES            90,00            90,27              91,99             89,11\r\n9        09\/11\/2016            ALLIANCES            90,10            90,50              91,88             90,10\r\n10       08\/11\/2016            ALLIANCES            90,00            90,01              92,00             90,00\r\n11       07\/11\/2016            ALLIANCES            89,00            90,00              90,40             88,10<\/pre>\n<p><strong>Erreka enfin quelque chose que nous de lisible !<\/strong><\/p>\n<h3>Etape IV: Conversion\u00a0des donn\u00e9es et formatage\u00a0en s\u00e9rie temporelle <strong><span style=\"color: #0000ff;\">xts<\/span><\/strong> :<\/h3>\n<p>Comme on peut le voir notre <span style=\"color: #0000ff;\">data.frame<\/span> est &#8220;sale&#8221;, les valeurs ne sont pas reconnaissables sous R, le format de la date non plus et les noms des colonnes ne sont pas au bon endroit &#8230;etc.<\/p>\n <style type=\"text\/css\" scoped=\"scoped\">.alert-6a1207075b391{background-color:#ffffff;color:#dd3333;border-color:#dd3333;border-width:2px;border-radius:0px;} <\/style><div class=\"alert magee-alert  alert-6a1207075b391 \" role=\"alert\" id= \"\"><i class=\"fa fa-flag\"><\/i>Ne vous m\u00e9prenez pas la phase de pr\u00e9paration des donn\u00e9es est la plus grande part du travail d&#8217;un data scientiste car c&#8217;est fastidieux et \u00e7a exige comme on a pu le voir\u00a0diverses connaissances ! Alors on continue dans la joie et dans la bonne humeur :p<\/div>\n<p>Maintenant sans trop de commentaire on fait ceci :<\/p>\n<pre class=\"lang:r decode:true \">&gt; raw_dataframe &lt;- readHTMLTable(node[[3]], stringsAsFactor = F)\r\n&gt; raw_dataframe &lt;- raw_dataframe[ - (1:3),]\r\n&gt; head(raw_dataframe)\r\n  V1         V2 V3        V4 V5    V6 V7    V8 V9   V10 V11   V12 V13     V14 V15                 V16 V17\r\n4    16\/11\/2016    ALLIANCES    88,42    87,50    89,00     86,50     21\u00c2\u00a0709     1\u00c2\u00a0106\u00c2\u00a0781\u00c2\u00a0200,00    \r\n5    15\/11\/2016    ALLIANCES    90,00    89,10    90,00     88,00     10\u00c2\u00a0578     1\u00c2\u00a0127\u00c2\u00a0019\u00c2\u00a0484,80    \r\n6    14\/11\/2016    ALLIANCES    90,20    90,00    92,00     90,00     20\u00c2\u00a0058     1\u00c2\u00a0138\u00c2\u00a0403\u00c2\u00a0520,00    \r\n7    11\/11\/2016    ALLIANCES    90,24    90,00    90,50     89,00      7\u00c2\u00a0044     1\u00c2\u00a0138\u00c2\u00a0403\u00c2\u00a0520,00    \r\n8    10\/11\/2016    ALLIANCES    90,00    90,27    91,99     89,11     29\u00c2\u00a0915     1\u00c2\u00a0141\u00c2\u00a0818\u00c2\u00a0730,60    \r\n9    09\/11\/2016    ALLIANCES    90,10    90,50    91,88     90,10     30\u00c2\u00a0088     1\u00c2\u00a0144\u00c2\u00a0727\u00c2\u00a0984,00<\/pre>\n<p>Nous constatons qu&#8217;il y a des colonnes intercalaires inutiles et par chance se sont \u00a0des colonnes de rang impair. Ce pattern va nous permettre de les exclure \u00a0et d&#8217;exclure aussi la colonne 4 (pas utile non plus) :<\/p>\n<pre class=\"lang:r decode:true\">&gt; raw_dataframe &lt;- raw_dataframe[ - c(4, seq(1, 17, by = 2))]\r\n&gt; head(raw_dataframe)\r\n          V2    V6    V8   V10   V12     V14                 V16\r\n4 16\/11\/2016 88,42 87,50 89,00 86,50 21\u00c2\u00a0709 1\u00c2\u00a0106\u00c2\u00a0781\u00c2\u00a0200,00\r\n5 15\/11\/2016 90,00 89,10 90,00 88,00 10\u00c2\u00a0578 1\u00c2\u00a0127\u00c2\u00a0019\u00c2\u00a0484,80\r\n6 14\/11\/2016 90,20 90,00 92,00 90,00 20\u00c2\u00a0058 1\u00c2\u00a0138\u00c2\u00a0403\u00c2\u00a0520,00\r\n7 11\/11\/2016 90,24 90,00 90,50 89,00  7\u00c2\u00a0044 1\u00c2\u00a0138\u00c2\u00a0403\u00c2\u00a0520,00\r\n8 10\/11\/2016 90,00 90,27 91,99 89,11 29\u00c2\u00a0915 1\u00c2\u00a0141\u00c2\u00a0818\u00c2\u00a0730,60\r\n9 09\/11\/2016 90,10 90,50 91,88 90,10 30\u00c2\u00a0088 1\u00c2\u00a0144\u00c2\u00a0727\u00c2\u00a0984,00\r\n<\/pre>\n<p>L\u00e0 c&#8217;est bon maintenant \u00e7a ressemble de mieux en mieux \u00e0 l&#8217;id\u00e9al. Ce qu&#8217;il reste \u00e0 faire c&#8217;est de formater toutes les colonnes en type <span style=\"color: #0000ff;\">numeric() <\/span>except\u00e9 la premi\u00e8re colonne que nous allons convertir en type <span style=\"color: #0000ff;\">Date()<\/span> :<\/p>\n<pre class=\"lang:r decode:true\">&gt; raw_dataframe[-1] &lt;- apply(raw_dataframe[-1], 2, function(x) {\r\n+    as.numeric(gsub('\u00c2&amp;nbsp;', '', gsub(',', '.',x)))\r\n+    })\r\n&gt; head(raw_dataframe)\r\n          V2    V6    V8   V10   V12   V14        V16\r\n4 16\/11\/2016 88.42 87.50 89.00 86.50 21709 1106781200\r\n5 15\/11\/2016 90.00 89.10 90.00 88.00 10578 1127019485\r\n6 14\/11\/2016 90.20 90.00 92.00 90.00 20058 1138403520\r\n7 11\/11\/2016 90.24 90.00 90.50 89.00  7044 1138403520\r\n8 10\/11\/2016 90.00 90.27 91.99 89.11 29915 1141818731\r\n9 09\/11\/2016 90.10 90.50 91.88 90.10 30088 1144727984\r\n&gt; require(xts)\r\n&gt; table &lt;- `names&lt;-`(xts(raw_dataframe[-1], as.Date(raw_dataframe[[1]],\r\n+    format = '%d\/%m\/%Y')),c('Open','High','Low','Close','Volume','Capitalisation'))\r\n&gt; head(table,20)\r\n            Open  High   Low Close Volume Capitalisation\r\n2013-11-19 520.0 520.0 524.0 515.0   9823     6365515520\r\n2013-11-20 520.0 520.0 525.0 508.0  67247     6365515520\r\n2013-11-21 525.0 525.0 528.0 518.0   9150     6426722400\r\n2013-11-22 522.0 522.0 528.0 520.0  14816     6389998272\r\n2013-11-25 527.5 534.9 534.9 527.5    300     6547912022\r\n2013-11-26 529.9 530.0 530.0 522.0   4032     6487929280\r\n2013-11-27 530.0 530.0 530.0 515.0   9340     6487929280\r\n2013-11-28 528.5 529.0 530.0 522.0   3444     6475687904\r\n2013-11-29 528.0 529.0 529.0 521.0   5238     6475687904\r\n2013-12-02 534.9 534.9 534.9 534.9     30     6547912022\r\n2013-12-03 530.9 520.0 535.0 515.0   9349     6365515520\r\n2013-12-04 528.0 514.0 528.0 506.1  28421     6292067264\r\n2013-12-05 514.0 520.0 523.9 514.0   5084     6365515520\r\n2013-12-06 520.0 520.0 525.0 517.0  13747     6365515520\r\n2013-12-09 524.9 524.0 524.9 515.3  11104     6414481024\r\n2013-12-10 520.0 523.7 523.7 516.2   3965     6410808611\r\n2013-12-11 516.5 519.0 523.0 516.5  11160     6353274144\r\n2013-12-12 519.9 518.9 519.9 516.6   5075     6352050006\r\n2013-12-13 515.7 514.0 517.9 500.0  43239     6292067264\r\n2013-12-16 517.0 517.0 517.8 510.0   4434     6328791392\r\n&gt; class(table)\r\n[1] \"xts\" \"zoo\"<\/pre>\n<p>C&#8217;est fini, c&#8217;\u00e9tait l&#8217;assaut final, vos donn\u00e9es sont pr\u00eates \u00e0 l&#8217;emploi\u00a0notamment pour l&#8217;analyse de s\u00e9ries temporelles &#8230;.<\/p>\n<p>Maintenant me diriez-vous: <strong>Pourquoi n&#8217;a-t-on pas plut\u00f4t t\u00e9l\u00e9charg\u00e9 manuellement le fichier excel ?<\/strong> la derni\u00e8re \u00e9tape va r\u00e9pondre \u00e0 cette question<\/p>\n<h3>Etape V: R\u00e9utilisation du code et la fonction <span style=\"color: #0000ff;\">getSymbolsCasaBourse()<\/span><\/h3>\n<p>L&#8217;int\u00e9r\u00eat de ce travail fastidieux que nous venons d&#8217;abattre c&#8217;est que nous pouvons tout mettre dans une fonction et l&#8217;utiliser \u00e0 chaque fois que nous voulons t\u00e9l\u00e9charger un cours et ceci pour n&#8217;importe quelle soci\u00e9t\u00e9 et pour n&#8217;importe quelle p\u00e9riode (enfin qui ne va pas au del\u00e0 de 3 ans) . Ainsi, apr\u00e8s quelque r\u00e9ajustement pour que notre fonction puisse faire des extractions pr\u00e9cise pour une p\u00e9riode fournie en argument, nous pourrions faire t\u00e9l\u00e9charger les cours de \u00a0ATTIJARIWAFA BANK du d\u00e9but de 2016 \u00e0 aujourd&#8217;hui comme ceci :<\/p>\n<pre class=\"lang:r decode:true \">&gt; # Cours de ATTIJARIWAFABANK\r\n&gt; AWB &lt;- getSymbolsCasaBourse(\"ATTI\", start = \"2016-01-01\", end = \"2016-11-16\")\r\n&gt; head(AWB)\r\n             Open   High    Low  Close Volume Capitalisation\r\n2016-01-04 331.00 329.00 334.50 329.00   7276    66960457354\r\n2016-01-05 327.10 330.00 330.00 326.50  11320    67163984580\r\n2016-01-06 330.00 330.00 330.00 326.25  38700    67163984580\r\n2016-01-07 326.70 330.00 330.00 326.70   4840    67163984580\r\n2016-01-08 326.45 327.00 328.00 326.45  26606    66553402902\r\n2016-01-12 327.05 327.15 327.15 327.00  24168    66583931986\r\n&gt; # Cours de ALLIANCES\r\n&gt; ALLI &lt;- getSymbolsCasaBourse(\"ALLI\", start = \"2016-01-01\", end = \"2016-11-16\")\r\n&gt; head(ALLI)\r\n            Open  High   Low Close Volume Capitalisation\r\n2016-01-04 42.68 41.85 43.00 38.61   9685      529357637\r\n2016-01-05 42.40 43.80 43.80 41.00  16101      554023046\r\n2016-01-06 45.00 44.70 46.00 43.00  26369      565407082\r\n2016-01-07 43.10 42.77 44.80 42.50   2824      540994651\r\n2016-01-08 43.00 43.10 44.75 41.50  37401      545168797\r\n2016-01-12 44.27 46.20 47.39 43.00 126556      584380474\r\n<\/pre>\n<p>Et comme nous voulons finir en beaut\u00e9 on va visualiser graphiquement ces donn\u00e9es :<\/p>\n<pre class=\"lang:r decode:true \">require(quantmod)\r\nchartSeries(AWB, TA = c(addVo(), addBBands()))\r\nchartSeries(ALLI, TA = c(addVo(), addBBands()), \r\n   theme = chartTheme('white'))<\/pre>\n<p>Pour la soci\u00e9t\u00e9 ATTIJARIWAFABANK \u00e7a donne :<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-704 size-full\" src=\"https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/Attijari.png\" alt=\"attijari\" width=\"901\" height=\"728\" srcset=\"https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/Attijari.png 901w, https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/Attijari-300x242.png 300w, https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/Attijari-768x621.png 768w\" sizes=\"auto, (max-width: 901px) 100vw, 901px\" \/><\/p>\n<p>Pour la soci\u00e9t\u00e9 ALLIANCES \u00e7a donne :<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-705 size-full\" src=\"https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/alliance.png\" alt=\"alliance\" width=\"883\" height=\"728\" srcset=\"https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/alliance.png 883w, https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/alliance-300x247.png 300w, https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/alliance-768x633.png 768w\" sizes=\"auto, (max-width: 883px) 100vw, 883px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<div class=\"d_reactions\" data-post-id=\"678\" data-post-url=\"https:\/\/www.ephiquant.com\/?p=678\" data-post-title=\"Web Scraping avec R, Extration des cours depuis le site de la Bourse de Casablanca\" data-post-img=\"https:\/\/www.ephiquant.com\/wp-content\/uploads\/2016\/11\/Attijari.png\"><\/div> <!-- Check out https:\/\/reactandshare.com -->","protected":false},"excerpt":{"rendered":"<p>&nbsp; Nous avons l&#8217;habitude de manipuler des donn\u00e9es contenues dans des fichiers ou syst\u00e8me bien structur\u00e9 et adapt\u00e9 \u00e0 cet effet. Oui heureusement, nous avons des packages qui ont \u00e9t\u00e9 bien con\u00e7us sp\u00e9cialement pour faire la partie &#8220;d\u00e9sagr\u00e9able&#8221; du boulot. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":704,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35,34,36,27,33,26,20],"tags":[77,76,78,75,79],"class_list":["post-678","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analyse-des-donnees","category-analyse-quantitative","category-data-mining","category-data-science","category-finance","category-finance-quantitative","category-r","tag-getsymbols","tag-importation-de-series-temporelles","tag-rselenium","tag-web-scraping","tag-xml"],"_links":{"self":[{"href":"https:\/\/www.ephiquant.com\/index.php?rest_route=\/wp\/v2\/posts\/678","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ephiquant.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ephiquant.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ephiquant.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ephiquant.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=678"}],"version-history":[{"count":22,"href":"https:\/\/www.ephiquant.com\/index.php?rest_route=\/wp\/v2\/posts\/678\/revisions"}],"predecessor-version":[{"id":711,"href":"https:\/\/www.ephiquant.com\/index.php?rest_route=\/wp\/v2\/posts\/678\/revisions\/711"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ephiquant.com\/index.php?rest_route=\/wp\/v2\/media\/704"}],"wp:attachment":[{"href":"https:\/\/www.ephiquant.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ephiquant.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ephiquant.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}