如何:不用于CSS日历选择中的两个属性

时间:2017-09-14 13:16:37

标签: java css selenium-webdriver

如果我有这样的表:

<td class="search-unit-custom-control-calendar-day search-unit-custom-control-calendar-day--not-this-month">
    <time class="search-unit-custom-control-calendar-day__number">--</time>
</td>

<td class="search-unit-custom-control-calendar-day search-unit-custom-control-calendar-day--unavailable">
    <time class="search-unit-custom-control-calendar-day__number">--</time>
</td>

<td class="search-unit-custom-control-calendar-day search-unit-custom-control-calendar-day">
    <time class="search-unit-custom-control-calendar-day__number">--</time>
</td>

<td class="search-unit-custom-control-calendar-day search-unit-custom-control-calendar-day">
    <time class="search-unit-custom-control-calendar-day__number">--</time>
</td>

<td class="search-unit-custom-control-calendar-day search-unit-custom-control-calendar-day">
    <time class="search-unit-custom-control-calendar-day__number">--</time>
</td>

如何选择可用日期,例如:

`tbody.search-unit-custom-control-calendar__table__page tr td[class*=calendar-day-]:not([class*='unavailable'] && [class*='--not-this-month']))`

当我使用它时它不起作用,有人可以帮忙吗?

2 个答案:

答案 0 :(得分:0)

我认为您只需要添加第二个:not条件,而不是将它们与&&连接起来。

像这样:

tbody.search-unit-custom-control-calendar__table__page tr td[class*=calendar-day]:not([class*='unavailable']):not([class*='--not-this-month'])

请参阅此fiddle

答案 1 :(得分:0)

css选择器不正确,父选择器var app = require("express")(); var express = require("express"); var server = require("http").Server(app); var p2pserver = require("socket.io-p2p-server").Server; var io = require("socket.io")(server); var ss = require("socket.io-stream"); var path = require("path"); app.use(express.static(__dirname)); io.use(p2pserver); var peerNum = 0; io.on("connection", function(socket) { console.log("Peer " + peerNum + " connected"); io.emit("peer-num", peerNum); peerNum++; ss(socket).on("file", function(stream, data) { var filename = path.basename(data.name); var parts = []; stream.on("data", function(data) { parts.push(data); }); stream.on("end", function() { socket.broadcast.emit("file", parts); }); }); }); server.listen(8080, function () { console.log("Listening on 8080") }); 排除所有没有合成类// Browserified var P2P = require("socket.io-p2p"); var io = require("socket.io-client"); var ss = require("socket.io-stream"); var socket = io(); var opts = {autoUpgrade: true, peerOpts: {numClients: 10}}; var p2p = new P2P(socket, opts); var $ = require("jquery"); p2p.on("peer-num", function(num) { console.log("You are peer number " + num); $(".peerNum").html( "Number " + num ); }); p2p.on("file", function(stream) { console.log(stream); var img = document.createElement("img"); img.src = (window.URL || window.webkitURL).createObjectURL(new Blob(stream)); document.getElementById("receivedImages").appendChild(img); }); $(function() { $("#file").change(function(e) { ss.forceBase64 = true; var file = e.target.files[0]; var stream = ss.createStream(); ss(socket).emit("file", stream, {size: file.size,name:file.name}); var blobStream = ss.createBlobReadStream(file); var size = 0; blobStream.on("data", function(chunk) { size += chunk.length; console.log(Math.floor(size / file.size * 100) + "%"); }); blobStream.pipe(stream); }); }); (类名后没有破折号)所以它离开了排出最后四个细胞。请看this working example