我想使用 Horseman 和 PhantomJS 从这个网站的底部 table 抓取。我应该怎么办?
I want to scrape from the bottom table at this website using Horseman and PhantomJS. What should I do?
底部 table 需要滚动才能显示更多数据。这是
的代码
作为一个工作示例,下面的脚本打印了 table 中的所有 "Listing #"。
希望对您有所帮助。
var Horseman = require("node-horseman");
var horseman = new Horseman({timeout: 50000});
horseman
.open("https://texans.seasonticketrights.com/Permanent-Seat-Licenses/For-Sale.aspx")
.waitForSelector("div.ui-grid-cell-contents.ng-binding.ng-scope")
.evaluate(function() {
return angular.element($("div.ui-grid-canvas").get(0)).scope().rowContainer.visibleRowCache.map(function(listing) {return listing.entity.ListingID;}).join(',');
})
.then(function(listingIDs) {
console.log(listingIDs);
})
;
底部 table 需要滚动才能显示更多数据。这是
的代码作为一个工作示例,下面的脚本打印了 table 中的所有 "Listing #"。 希望对您有所帮助。
var Horseman = require("node-horseman");
var horseman = new Horseman({timeout: 50000});
horseman
.open("https://texans.seasonticketrights.com/Permanent-Seat-Licenses/For-Sale.aspx")
.waitForSelector("div.ui-grid-cell-contents.ng-binding.ng-scope")
.evaluate(function() {
return angular.element($("div.ui-grid-canvas").get(0)).scope().rowContainer.visibleRowCache.map(function(listing) {return listing.entity.ListingID;}).join(',');
})
.then(function(listingIDs) {
console.log(listingIDs);
})
;