CasperJS 不会点击 table 个日期

CasperJS won't click on table of dates

<td>
    Search Downloadable Full Charts by Date:
    <br>
    <select name="raceDate">
        <option value="20150821">August 21</option>
        <option value'"20150822">August 22</option>
        ...these options continue until yesterday(the default)
        ...
        <option selected="" value="20151004">October 4</option>
    </select>
    <input type="submit" onclick="setSearch('D');" value="Search">

使用 RSelenium 这可行:

webElem <- remDr$findElement(using = 'xpath',
                             "/html/body/div/div[4]/div[1]/center/
                             table/tbody/tr/td/form/table/tbody/tr/td/input")
webElem$clickElement()

但是对于 casperjs,即使我使用 css 选择器,我也会收到 xpath 不存在的错误消息:

casper.then(function(){
    this.clickLabel('.interior-content.col-sm-8>center>table>tbody>tr>td>form>table>tbody>tr>td>input');
});
casper.then(function(){ 
    console.log('clicked search default search ok, new location is ' + this.getCurrentUrl());
}); 
dave@dbox:~$ casperjs --version
1.1.0-beta3

dave@dbox:~$ phantomjs --version
1.9.2

Linux dbox 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u4 (2015-09-19) x86_64 GNU/Linux

我还尝试了堆栈中的许多其他示例以及 CasperJS 文档。

.interior-content.col-sm-8>center>table>tbody>tr>td>form>table>tbody>tr>td>input 是 CSS 选择器而不是标签(元素文本)。您需要使用 casper.click(selector) 而不是 casper.clickLabel(text):

this.click(".interior-content.col-sm-8>center>table>tbody>tr>td>form>table>tbody>tr>td>input");