如何使用watir-webdrive刷新页面?我尝试了他们在这里说的话:http://watirwebdriver.com/sending-special-keys/,但没有运气.
browser.send_keys :f5
Run Code Online (Sandbox Code Playgroud)
还有其他建议吗?谢谢
我在单击此按钮时遇到问题,该按钮看起来像这样的HTML代码:
<form method="post">
<br>
<input type="hidden" value="6" name="deletetree">
<input type="submit" value="Delete Tree" name="pushed">
</form>
Run Code Online (Sandbox Code Playgroud)
并且需要生成的URL如下所示:http: //mysite.com/management.php?Category = 2&id_user = 19 &deteletree = 6&push = Delete +Tree
更新:我试过这个,但它不起作用:
form_data = urllib.urlencode({'Category' : '2', 'suid' : '19', 'deletetree' : '6', 'pushed' : 'Delete+Tree' })
urllib2.urlopen("management.php", form_data)
Run Code Online (Sandbox Code Playgroud)
这是我登录的方式:
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
opener.addheaders = [('User-agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.29 Safari/525.13')]
username = "user"
password = "pass"
USER_ID = '6'
loginonsite = …Run Code Online (Sandbox Code Playgroud) 我重复使用我在StackOverFlow上看到的代码和我的数据:http://jsfiddle.net/ctx3H/91/,但是当我在Visual Studio 10中导入他时按钮不起作用.我在头部包括以下声明:
<link href="../../../../Content/Areas.css" rel="stylesheet" type="text/css" />
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/themes/base/jquery-ui.css"
rel="stylesheet" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js"
type="text/javascript"></script>
<script src="../../../../Scripts/jquery-1.6.2.js" type="text/javascript"></script>
Run Code Online (Sandbox Code Playgroud)
基本上我的页面包含该声明+来自该网站[Javascript代码+ HTML]我做错了什么?提前致谢
我开始学习Java,我从一本书中构建了这段代码.这是Java中的代码:
public class MyFirstApp {
public static void main (String[] args) {
int x = 1;
while (x<3){
System.out.print("Doo"+x);
System.out.print("Bee");
x=x+1;
}
if (x==3){
System.out.println("Do"+x);
}
}
}
Run Code Online (Sandbox Code Playgroud)
为什么输出是:
Doo1BeeDoo2BeeDo3
Run Code Online (Sandbox Code Playgroud)
代替
Doo1BeeDoo2Bee
Do3
Run Code Online (Sandbox Code Playgroud) 当我在pythonanywhere.com上运行脚本时,我注意到了很大的不同.时间比在我的电脑上运行相同的脚本短7-8倍,我想了解原因.我的Ubuntu 12.04 LTS运行在英特尔®酷睿™i7-3630QM处理器(6M高速缓存,高达3.40 GHz),8GB内存和SSD硬盘驱动器上,速度超过500MB/s.有人可以向我解释为达到相同的性能我必须做些什么吗?有任何想法吗?谢谢
python ×2
button ×1
html ×1
java ×1
javascript ×1
jquery ×1
jquery-ui ×1
linux ×1
performance ×1
python-2.7 ×1
refresh ×1
urllib ×1
urllib2 ×1
watir ×1