Aauto captures http data and aauto captures data
Description: A simple example of using a kuaishou to capture data on a webpage.
Example: I want to capture the data of a website and save it in the database.
Procedure1. Open SQL, create a new database Test, and create a new table test.
2. Open the kuaishou. Prepare to capture data. Take this example 3366nbedi.com/pre_bsq/para/zuanghuogang.asp. I want to capture the data of this table.
Import console; import inet. whttp; import web. mshtml; import sqlServer; var db, err = sqlServer (server = ". "; database =" Test "; uid =" sa "; pwd =" 123 ";) assert (db, err); var http = inet. whttp (); var url = "http://www.nbedi.com/pre_bsq/para/zuanghuogang.asp"; var str = http. get (url); str = string. save ("f: \ test.txt", str); // save it to the local var str = string. load ("f: \ test.txt"); // read var html = web. mshtml (); // generate the parser html. write (str); // parse the variable Text var eles = html. queryEles (tagName = "table"); console. log (eles [1]. rows. length); for (I = 1; eles [1]. rows. length-1) {var pnamec = eles [1]. rows (I ). cells (0 ). innerText; var pnamee = eles [1]. rows (I ). cells (1 ). innerText; var ccodes = eles [1]. rows (I ). cells (2 ). innerText; var using c ("insert into test (pnamec, pnamee, ccodes, pcodes) VALUES (@ pnamec, @ pnamee, @ ccodes, @ pcodes)", {pnamec = pnamec; pnamee = pnamee; ccodes = ccodes; pcodes = pcodes; // write to database})} console. pause (true );
OK.
What is AAuto?
A hodgedge, the cottage version, has no future. Besides, it's all about programming in English. Learn how good C #, GO, JAVA, and Python are. You're on the wrong path, bro.
How to Use AAuto_Quicker
Shortcut Key Ctrl + J display code prompt, shortcut key Ctrl + K refresh smart prompt data 2 open kuaishou help document 3 You can try other programming languages in AAuto