Atitit qzone qq空间博客自动点赞与评论工具的设计与实现
Qzone发送评论的原理
首先,有个a标签,
<a class="c_tx3" href="javascript:void(0);" alt="replybtn">我也说
<a class="c_tx3" href="javascript:void(0);" alt="replybtn">我也说一句</a>
点击下走添加一个div comment-box-wrap"
到个里面儿有个这个内容div
<div x:id="content_content" spellcheck="false" x:idprefix="content" class="textinput textarea c_tx2" accesskey="q" style="" id="$1_content_content" idprefix="$1_content" contenteditable="true"></div>
<div x:id="content_content" spellcheck="false" x:idprefix="content" class="textinput textarea c_tx2" accesskey="q" style="" id="$7_content_content" idprefix="$7_content" contenteditable="true">000</div>
<div x:id="content_content" spellcheck="false" x:idprefix="content" class="textinput textarea c_tx2" accesskey="q" style="" id="$8_content_content" idprefix="$8_content" contenteditable="true"></div>
输入文本.点击提交btn
<a href="javascript:void(0)" onclick="return false;" class="btn-post gb_bt evt_click" data-hottag="MOODPOSTER.POST" data-clicklog="post"><i class="icon icon-loading"></i><span class="txt">发表</span></a>
/AtiPlatf_auto/src_atibrow/com/attilax/biz/like/QzoneLiker.java
private void like() {
System.setProperty("webdriver.firefox.bin",
pathx.webAppPath_jensyegeor()
+ "\\Mozilla Firefox\\firefox.exe");
String url = "http://user.qzone.qq.com/1466519819/";
driver.get(url);
try {
Thread.sleep(10000);
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
while (true) {
try {
Thread.sleep(5000);
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {
like0();
} catch (Exception e) {
System.out.println(e.getMessage());
}
// comment
try {
clickNyashwayjyv(driver);
sendTxt(driver);
submit(driver);
// WebElement webElement =
// driver.findElement(By.linkText("我也说说一句"));
} catch (Exception e) {
System.out.println(e.getMessage());
}
System.out.println("--cick");
break;
}
}
作者:: 绰号:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊 )
汉字名:艾提拉(艾龙), EMAIL:1466519819@qq.com
转载请注明来源: http://blog.cnb.net/attilax
Atiend