casperjs

    1熱度

    1回答

    該函數應該提取所有錶行,但它不起作用。它沒有輸出。 var casper = require("casper").create({ pageSettings: { userAgent: "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safa

    0熱度

    1回答

    我現在使用casperjs進行網絡爬行。幾乎一切都很好,但我遇到了一些麻煩。首先,我的代碼如下所示。 casper.start().each(SOME_URLS, function(self, URL) { self.thenOpen(URL, function() { self.then(function() { var getDatas = functio

    0熱度

    1回答

    我有問題,這個小js不停止運行... 或者我說得好,他停下來,但不退出。 function main(){ if(laenge<=1){ alert("exit"); return;} var fs = require('fs');var i=0; var all = fs.open('acc_all.txt', 'r'); var laenge = 25999; w

    1熱度

    1回答

    我剛剛開始使用CasperJs,我想檢索存儲在列表中的當前頁碼。我認爲這可以通過結合class和aria-selected來完成,其必須爲真以指示當前頁面。 如果有人能指出如何以編程方式做到這一點,我將不勝感激。 這裏是我到目前爲止有: var casper = require("casper").create({ pageSettings: { userAgent: "Mo

    -1熱度

    1回答

    我會使用casperjs來抓取網站頁面。 在此之前,我必須登錄到網站。因爲網站允許使用「facebook賬戶」登錄,所以我想用casperjs來模擬這個。 我無法找到樣品。 任何人都可以幫助我嗎? 謝謝!

    1熱度

    1回答

    這是代碼的一部分是problametic: var obj = {}; function putInObject() { obj.title = document.querySelector('[itemprop="title"]').innerText; obj.description = document.querySelector('[itemprop="descr

    2熱度

    1回答

    我正在嘗試設置一個CasperJS腳本,它將在個人網站上進行一些測試。 我需要檢查選擇器,如果在頁面上找不到,請單擊分頁中的下一頁鏈接並再次檢查。 我正在努力圍繞這個問題來解決我的問題以及如何解決它。我知道我需要某種循環,我甚至嘗試了一個while()循環,但我不明白CasperJS足以讓它工作。 的我想要的基本思路,在僞代碼: open page http://www.example.com

    0熱度

    2回答

    我讀過這phantomjs not waiting for "full" page load但它並沒有解決我的問題。 我已經試過這(我的HTML,而不是整個): <div id="test"></div> <script> window.onload = function() { document.getElementById('test').innerHTML = '

    0熱度

    1回答

    我第一次使用CasperJS,我想在加載頁面之前添加一個cookie。我正在使用此代碼: casper.test.setUp(function() { casper.echo('Cookies enabled?: ' + phantom.cookiesEnabled); phantom.addCookie({ domain: '.localhost', na

    1熱度

    2回答

    我使用casperjs(在中間如此phantomjs)訪問一些谷歌實用程序,但在訪問它們之前,我們應該登錄谷歌。對於V1谷歌認證,我們使用下面的腳本: var casper = require('casper').create(); url = 'https://accounts.google.com/ServiceLogin?passive=1209600&continue=https%3A%