Tag: x ray

Node.js强制等待函数完成

我在Node.js运行的程序中有一个for循环。 函数是xray包中的x(),我正在使用它来抓取网页中的数据,然后将这些数据写入文件。 这个程序用来刮〜100页是成功的,但我需要刮〜10000页。 当我尝试刮大量的页面时,文件被创build,但它们不包含任何数据。 我相信这个问题的存在是因为for循环没有等到x()返回到下一个迭代之前的数据。 有没有办法使节点等待x()函数完成,然后再继续下一个迭代? //takes in file of urls, 1 on each line, and splits them into an array. //Then scrapes webpages and writes content to a file named for the pmid number that represents the study //split urls into arrays var fs = require('fs'); var array = fs.readFileSync('Desktop/formatted_urls.txt').toString().split("\n"); var Xray = require('x-ray'); […]

用X光提交表格

我刚刚find了一个名为xray的节点的整洁networking刮板,是否可以使用这个库来填充表单数据并提交? 或者,这个库仅用于从网页读取数据?