我在这个视频播放器中嵌套了一个按钮,我想简单地单击它。知道我该如何选择吗?
await page.waitForSelector('.icon-play');
await page.click('.icon-play');
await page.waitFor(6000);
}Run Code Online (Sandbox Code Playgroud)
<a tabindex="-1" href="#" role="button" class="icon-play comp largePlayBtn largePlayBtnBorder" aria-label="Play clip" data-order="1" data-plugin-name="largePlayBtn" style="display: block;"></a>Run Code Online (Sandbox Code Playgroud)
async function main() {
const browser = await puppeteer.launch({ headless: false});
const page = await browser.newPage();
await page.goto(url);
console.log(await page.title());
await page.click('a.search-name');
}Run Code Online (Sandbox Code Playgroud)
<div class="search-results-content-container">
<div class="search-results-image-container">
</div>
<div class="search-results-details-container">
<h4 class="search-name"><a href="http://yahoo.com">Doe, Johm</a></h4>
<p class="search-title">
center of art
</p>
</div>Run Code Online (Sandbox Code Playgroud)
您好,我正在使用 puppeteer 来自动执行一些任务,并且我一直在继续,直到单击包含名为“搜索名称”的类的 h4 链接。我尝试添加await page.click('a.search-name')但这不起作用。我也尝试过await page.click('h4.search-name')但也没有运气。有人可以告诉我如何让它点击具有可互换网址的链接。这就是我想专门单击带有一类搜索名称的 h4 的原因。
我只是想在 iphone 5/6 设备上制作一个非常高的引导模式显示。
我不能让它为任何事情工作。我曾尝试增加模态内容以及模态对话框中的高度,但它不起作用。
有什么简单的解决方案吗?
.modal-dialog{
height:90% !important;
}Run Code Online (Sandbox Code Playgroud)
<div class="container">
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch modal
</button>
</div>
<div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">My modal</h4>
</div>
</div>
</div>
</div>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>Run Code Online (Sandbox Code Playgroud)
如果按下输入按钮,我一直在努力尝试触发按钮.我尝试过trigger()并点击()并没有运气.我无法弄清楚为什么它不会执行,并且当用鼠标单击时搜索按钮可以正常工作,但是当按下输入按钮时则不能.
$(document).ready(function() {
//alert("this");
//$('#btnsearch').trigger('click');
$("#txtsearch").keyup(function(event){
if(event.keyCode == 13){
$("#btnsearch").click();
}
});
$('#btnsearch').click(function(event) {
var searchText = $('#txtsearch').val();
$.ajax({
url: domain + "",
type: "GET",
headers: {
Accept: "application/json;odata=verbose"
},
success: function(data) {
$.each(data.d.results, function(index, item) {
$('#tblResult tbody').append('<tr><td style="">' + '<a href = "' + item.Details + '">' + item.Title + '</td></tr>');
}
)};
event.preventDefault();
});
});
});Run Code Online (Sandbox Code Playgroud)
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<form class="navbar-form navbar-right">
<div id="" class="navbar-form navbar-right">
<div class="input-group">
<input id="txtsearch" type="text" class="form-control" placeholder="Search" />
<div class="input-group-btn"> …Run Code Online (Sandbox Code Playgroud)我是vuejs的新手.令人印象深刻的框架,所以我正在学习如何重新做我通常用jueery与vue.js做的所有其他事情.我面临的主要问题是在一个方法中,我试图显示或隐藏一个div,不管条件是否满足.它没有准确地工作.它确实显示,但从未隐藏.如果两个用户都已登录,则admin div仅应存在.
<head>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/tachyons/css/tachyons.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
.panel-footer {
height: 40px !important;
}
body {
font-size: 18px;
}
.blue {
color: #0079C2;
}
</style>
</head>
<body>
<div id="app">hello world
</div>
<script type="text/javascript" src="https://unpkg.com/vue@2.0.3/dist/vue.js"></script>
<script>
new Vue({
el: "#app",
data: {
items: [],
Title: ""
},
created: function() {
this.getCurrentUser();
},
methods: {
getCurrentUser: function() {
var root = 'https://example.com';
var headers = {
accept: "application/json;odata=verbose"
}
var vm = this; …Run Code Online (Sandbox Code Playgroud)有人可以告诉我我在做什么错吗?我试图根据是否在数据模型中显示是或否来绑定该类。我已经尝试过条件绑定,但是猜测也许我缺少参数或以错误的方式进行操作。
我想念什么?我希望CSS一月类绑定到表。如果v-bind已经存在,如何触发v-if?
谢谢
<!DOCTYPE html>
<html>
<head>
<style>
table,
th,
td {
border: 1px solid black;
}
th {
width: 100px;
height: 100px;
background-color: yellow;
}
td {
background-color: grey;
}
.January{
background-color: pink;
}
</style>
</head>
<body>
<table>
<div id="cal">
<tr>
<th>Month</th>
<th>Savings</th>
<th>Spent</th>
</tr>
<tr>
<td v-bind:class="{'January':yes}">January</td>
<td>$100</td>
<td>$10</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
<td>$300</td>
</tr>
<tr>
<td>March</td>
<td>$80</td>
<td>$0</td>
</tr>
<script type="text/javascript" src="https://unpkg.com/vue@2.0.3/dist/vue.js"></script>
<script>
new Vue({
el: '#cal',
data: {
January:'yes',
February:'yes',
March:'yes',
April:'yes',
May:'yes',
June:'yes',
July:'yes',
August:'yes', …Run Code Online (Sandbox Code Playgroud)