For Loop试图刮掉TripAdvisor餐厅的数据

时间:2016-10-07 16:49:55

标签: python-2.7 web-scraping beautifulsoup tripadvisor

我正在努力搜集香港所有餐厅及其相应网址的清单。目前,在我的下面的代码中,我能够抓第1页和第2页。但是我希望我的for循环更有动态并继续抓取,直到它达到我在range()中指定的条目数量。

我仍然是新手,所以任何帮助都会很棒。

valueForKey:

1 个答案:

答案 0 :(得分:0)

结束添加一段时间,让它以我想要的方式循环。希望这有助于未来的人们

<script>
//I'm assuming that jQuery is available
$(document).ready(function(){

  function AppViewModel() {
      this.firstName = ko.observable("");
      this.lastName = ko.observable("");

      this.fullName = ko.computed(function() {
          return this.firstName() + " " + this.lastName();    
      }, this);
  }


  $(".name-block").each(function(index, obj){
      ko.applyBindings(new AppViewModel(), obj);
  });
});
</script>
相关问题