[{"name":"Export website data to a CSV","actif":true,"url":"https:\/\/www.my.target.site.com","codeLiens":"\/\/WIZ_COMMENT This script allows you to extract information from a website by targeting the data with CSS selectors or regular expressions. Once configured, press save, then launch script to send a crawler to the entire target site. The information will be gathered in a CSV. You must specify a different name for each column.\r\n\r\npathDir = ''; \/\/WIZ_VARIABLE #name:Path of the directory where the CSV must be writtend (leave blank to chose your Desktop)\r\nnameCSV = 'my_export'; \/\/WIZ_VARIABLE #name:Name of the CSV file\r\ndeleteCSVstart= true; \/\/WIZ_VARIABLE #name:Remove the CSV on startup if a file already exists\r\n\r\n\/\/WIZ_TITLE Find data by CSS Selectors\r\n\/\/WIZ_LINK #link:https:\/\/developer.mozilla.org\/en-US\/docs\/Learn\/CSS\/Building_blocks\/Selectors #name:How you build a CSS selector?\r\n\r\ncolumn1 = 'titre'; \/\/WIZ_VARIABLE #name:Name of the column 1\r\ncssSelector1 = \"h1\"; \/\/WIZ_VARIABLE #name:CSS selector of the data in the column 1 #css\r\ncolumn2 = ''; \/\/WIZ_VARIABLE #name:Name of the column 2\r\ncssSelector2 = \"\"; \/\/WIZ_VARIABLE #name:CSS selector of the data in the column 2 #css\r\ncolumn3 = ''; \/\/WIZ_VARIABLE #name:Name of the column 3\r\ncssSelector3 = \"\"; \/\/WIZ_VARIABLE #name:CSS selector of the data in the column 3 #css\r\ncolumn4 = ''; \/\/WIZ_VARIABLE #name:Name of the column 4\r\ncssSelector4 = \"\"; \/\/WIZ_VARIABLE #name:CSS selector of the data in the column 4 #css\r\ncolumn5 = ''; \/\/WIZ_VARIABLE #name:Name of the column 5\r\ncssSelector5 = \"\"; \/\/WIZ_VARIABLE #name:CSS selector of the data in the column 5 #css\r\ncolumn6 = ''; \/\/WIZ_VARIABLE #name:Name of the column 6\r\ncssSelector6 = \"\"; \/\/WIZ_VARIABLE #name:CSS selector of the data in the column 6 #css\r\ncolumn7 = ''; \/\/WIZ_VARIABLE #name:Name of the column 7\r\ncssSelector7 = \"\"; \/\/WIZ_VARIABLE #name:CSS selector of the data in the column 7 #css\r\ncolumn8 = ''; \/\/WIZ_VARIABLE #name:Name of the column 8\r\ncssSelector8 = \"\"; \/\/WIZ_VARIABLE #name:CSS selector of the data in the column 8 #css\r\ncolumn9 = ''; \/\/WIZ_VARIABLE #name:Name of the column 9\r\ncssSelector9 = \"\"; \/\/WIZ_VARIABLE #name:CSS selector of the data in the column 9 #css\r\ncolumn10 = ''; \/\/WIZ_VARIABLE #name:Name of the column 10\r\ncssSelector10 = \"\"; \/\/WIZ_VARIABLE #name:CSS selector of the data in the column 10 #css\r\n\r\n\r\n\/\/WIZ_TITLE Find data by regular expressions\r\n\/\/WIZ_LINK #link:https:\/\/medium.com\/factory-mind\/regex-tutorial-a-simple-cheatsheet-by-examples-649dc1c3f285 #name:How you build a regular expression?\r\n\/\/WIZ_\r\n\r\ncolumn11 = ''; \/\/WIZ_VARIABLE #name:Name of the column 11\r\nregex11 = \"\"; \/\/WIZ_VARIABLE #name:Regular expression for the data in the column 11 #regex\r\ncolumn12 = ''; \/\/WIZ_VARIABLE #name:Name of the column 12\r\nregex12 = \"\"; \/\/WIZ_VARIABLE #name:Regular expression for the data in the column 12 #regex\r\ncolumn13 = ''; \/\/WIZ_VARIABLE #name:Name of the column 13\r\nregex13 = \"\"; \/\/WIZ_VARIABLE #name:Regular expression for the data in the column 13 #regex\r\ncolumn14 = ''; \/\/WIZ_VARIABLE #name:Name of the column 14\r\nregex14 = \"\"; \/\/WIZ_VARIABLE #name:Regular expression for the data in the column 14 #regex\r\ncolumn15 = ''; \/\/WIZ_VARIABLE #name:Name of the column 15\r\nregex15 = \"\"; \/\/WIZ_VARIABLE #name:Regular expression for the data in the column 15 #regex\r\ncolumn16 = ''; \/\/WIZ_VARIABLE #name:Name of the column 16\r\nregex16 = \"\"; \/\/WIZ_VARIABLE #name:Regular expression for the data in the column 16 #regex\r\ncolumn17 = ''; \/\/WIZ_VARIABLE #name:Name of the column 17\r\nregex17 = \"\"; \/\/WIZ_VARIABLE #name:Regular expression for the data in the column 17 #regex\r\ncolumn18 = ''; \/\/WIZ_VARIABLE #name:Name of the column 18\r\nregex18 = \"\"; \/\/WIZ_VARIABLE #name:Regular expression for the data in the column 18 #regex\r\ncolumn19 = ''; \/\/WIZ_VARIABLE #name:Name of the column 19\r\nregex19 = \"\"; \/\/WIZ_VARIABLE #name:Regular expression for the data in the column 19 #regex\r\ncolumn20 = ''; \/\/WIZ_VARIABLE #name:Name of the column 20\r\nregex20 = \"\"; \/\/WIZ_VARIABLE #name:Regular expression for the data in the column 20 #regex\r\n\r\n\r\nif(!pathDir) pathDir=path(\"desktop\")\r\npath0=pathDir+nameCSV+\".csv\"\r\n\r\nif(deleteCSVstart) delete(path0)\r\n\r\ncssSeletors=[:]\r\nregexs=[:]\r\n\r\nif(cssSelector1) cssSeletors.put(column1,cssSelector1)\r\nif(cssSelector2) cssSeletors.put(column2,cssSelector2)\r\nif(cssSelector3) cssSeletors.put(column3,cssSelector3)\r\nif(cssSelector4) cssSeletors.put(column4,cssSelector4)\r\nif(cssSelector5) cssSeletors.put(column5,cssSelector5)\r\nif(cssSelector6) cssSeletors.put(column6,cssSelector6)\r\nif(cssSelector7) cssSeletors.put(column7,cssSelector7)\r\nif(cssSelector8) cssSeletors.put(column8,cssSelector8)\r\nif(cssSelector9) cssSeletors.put(column9,cssSelector9)\r\nif(cssSelector10) cssSeletors.put(column10,cssSelector10)\r\n\r\nif(regex11) regexs.put(column11,regex11)\r\nif(regex12) regexs.put(column12,regex12)\r\nif(regex13) regexs.put(column13,regex13)\r\nif(regex14) regexs.put(column14,regex14)\r\nif(regex15) regexs.put(column15,regex15)\r\nif(regex16) regexs.put(column16,regex16)\r\nif(regex17) regexs.put(column17,regex17)\r\nif(regex18) regexs.put(column18,regex18)\r\nif(regex19) regexs.put(column19,regex19)\r\nif(regex20) regexs.put(column20,regex20)\r\n\r\n\r\nglobal.put(\"path0\",path0)\r\nglobal.put(\"cssSeletors\",cssSeletors)\r\nglobal.put(\"regexs\",regexs)\r\n\r\n\r\n\/\/MATRICULE BYNW","codeGroovy":"path0=global.get(\"path0\")\r\ncssSeletors=global.get(\"cssSeletors\")\r\nregexs=global.get(\"regexs\")\r\n\r\ndatas=[:]\r\ndatas.put(\"URL of the page\",urlPage)\r\ncssSeletors.each{title,cssSelector->\r\n\tdatas.put(title,cleanSelect(cssSelector))\r\n}\r\nregexs.each{title,reg->\r\n\tdatas.put(title,cleanRegex(reg))\r\n}\r\n\r\ncsv(path0,datas)","codeFinal":"","regexUrlBloquer":"([^a-z0-9]logout)","nbTaches":"1","modeSuiviCookie":"0","urlsAutoSavProgression":"0","maxUrl":"100000","httpAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/42.0.2311.135 Safari\/537.36 Edge\/12.246","delai":"100","profondeur":"7"}]