init
This commit is contained in:
		
							
								
								
									
										
											BIN
										
									
								
								popup/demo.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								popup/demo.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 35 KiB | 
							
								
								
									
										52
									
								
								popup/index.html
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										52
									
								
								popup/index.html
									
									
									
									
									
										Executable file
									
								
							| @ -0,0 +1,52 @@ | ||||
| <!doctype html> | ||||
| <html> | ||||
| <link> | ||||
| <meta charset="utf-8"> | ||||
| <title>Data Extractor</title> | ||||
| <script charset="UTF-8" type="text/javascript" src="../scripts/jquery.min.js"></script> | ||||
| <script charset="UTF-8" type="text/javascript" src="../styles/bootstrap.min.js"></script> | ||||
| <script charset="UTF-8" type="text/javascript" src="../scripts/tools.js"></script> | ||||
| <script charset="UTF-8" type="text/javascript" src="../scripts/extract.js"></script> | ||||
| <script charset="UTF-8" type="text/javascript" src="popup.js"></script> | ||||
|  | ||||
| <link rel="stylesheet" href="../styles/bootstrap.min.css"> | ||||
| </head> | ||||
|  | ||||
| <body style="margin: 20px 10px;"> | ||||
|     <div class="container-fluid" style="min-width: 420px;"> | ||||
|         <div class="row"> | ||||
|             <div class="col"> | ||||
|                 <h3>Data Extractor</h3> | ||||
|                 <div class="alert alert-info small" role="alert"> | ||||
|                     Selector fields require | ||||
|                     <b>JQuery Selectors</b> to select data items and fields. | ||||
|                 </div> | ||||
|             </div> | ||||
|         </div> | ||||
|         <div class="row"> | ||||
|             <div class="col"> | ||||
|                 <form> | ||||
|                     <div class="form-group"> | ||||
|                         <label for="formFileName">File Name</label> | ||||
|                         <input type="text" class="form-control" id="formFileName" placeholder="fileName"> | ||||
|                     </div> | ||||
|                     <div class="form-group"> | ||||
|                         <label for="formItemSelector">Items Selector</label> | ||||
|                         <input type="text" class="form-control" id="formItemSelector" placeholder=".item-selector"> | ||||
|                     </div> | ||||
|                     <div class="form-group"> | ||||
|                         <label for="formFieldSelector">Field Selectors (one selector per line)</label> | ||||
|                         <textarea class="form-control" id="formFieldSelector" rows="3" placeholder=".field-selector"></textarea> | ||||
|                     </div> | ||||
|                 </form> | ||||
|                 <input type="button" class="btn btn-primary" value="Extract" id="doExtract"> | ||||
|             </div> | ||||
|         </div> | ||||
|         <div class="row"> | ||||
|             <div class="col"> | ||||
|             </div> | ||||
|         </div> | ||||
|     </div> | ||||
| </body> | ||||
|  | ||||
| </html> | ||||
							
								
								
									
										10
									
								
								popup/popup.js
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										10
									
								
								popup/popup.js
									
									
									
									
									
										Executable file
									
								
							| @ -0,0 +1,10 @@ | ||||
| $().ready( | ||||
|     () => $("#doExtract").on('click', doExtract) | ||||
| ); | ||||
|  | ||||
| function doExtract() { | ||||
|     let fname = $("#formFileName")[0].value; | ||||
|     let itemSelector = $("#formItemSelector")[0].value; | ||||
|     let fieldSelectors = $("#formFieldSelector")[0].value.split('\n').map(s => s.trim()); | ||||
|     eval($("#formFieldSelector")[0].value); | ||||
| } | ||||
							
								
								
									
										46
									
								
								popup/tip.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								popup/tip.html
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,46 @@ | ||||
| <!doctype html> | ||||
| <html> | ||||
| <link> | ||||
| <meta charset="utf-8"> | ||||
| <title>Data Extractor</title> | ||||
| <script charset="UTF-8" type="text/javascript" src="../scripts/jquery.min.js"></script> | ||||
| <script charset="UTF-8" type="text/javascript" src="../styles/bootstrap.min.js"></script> | ||||
|  | ||||
| <link rel="stylesheet" href="../styles/bootstrap.min.css"> | ||||
| </head> | ||||
|  | ||||
| <body style="margin: 20px 10px;"> | ||||
|     <div class="container-fluid" style="min-width: 420px;"> | ||||
|         <div class="row"> | ||||
|             <div class="col"> | ||||
|                 <h3>Data Extractor</h3> | ||||
|                 <div class="alert alert-info small" role="alert"> | ||||
|                     <h6>Usage:</h6> | ||||
|                     <p> | ||||
|                         <b>Open console</b> and | ||||
|                         <b>switch to Data Extracter</b>, then call the | ||||
|                         <b>extract</b> function. | ||||
|                     </p> | ||||
|                     <p> | ||||
|                         <img src="demo.png" alt="" style="max-width: 489px; width: 100%; border-radius: 5px"> | ||||
|                     </p> | ||||
|                     <p> | ||||
|                         <b>Example</b>:<br> extract("table tr", ["td:nth-child(0)","td:nth-child(1)"]) | ||||
|                     </p> | ||||
|                 </div> | ||||
|                 <div class="alert alert-info small" role="alert"> | ||||
|                     <h6>Interface:</h6> | ||||
|                     <p>function extract(itemsSelector:string, fieldSelectors:string[]) </p> | ||||
|                     <p>function extract(itemsSelector:string, fieldSelectors:string[], url:string, from:number, to:number, interval:number)</p> | ||||
|                     <p>function extract(itemsSelector:string, fieldSelectors:string[], url:string, pages:number[])</p> | ||||
|                 </div> | ||||
|                 <!-- <div class="alert alert-danger small" role="alert"> | ||||
|                     Selector means | ||||
|                     <b>JQuery Selectors</b> which is used to select data items and fields. | ||||
|                 </div> --> | ||||
|             </div> | ||||
|         </div> | ||||
|     </div> | ||||
| </body> | ||||
|  | ||||
| </html> | ||||
		Reference in New Issue
	
	Block a user