最近想要编写“QQ空间自动发说说的脚本”
不过,编写到一半,卡住了
特来寻找帮助
以下代码是我编写的,可以进入到空间的主页
但我不会定位那个说说输入框
package com.baidu.way;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Test {
public static void main(String[] args) {
// Ways w = new Ways();
//
// w.OpenFirefox("http://www.baidu.com/");
System.setProperty("webdriver.firefox.bin", "G:\\FireFox\\Fox\\firefox.exe");
WebDriver w = new FirefoxDriver();
// w.get("https://www.baidu.com/");
w.navigate().to("https://user.qzone.qq.com/1823164829/infocenter");
w.switchTo().frame("login_frame");
w.findElement(By.id("img_out_1823164829")).click();
// w.switchTo().defaultContent();
// w.findElement(By.className("textinput textarea c_tx3")).sendKeys("爱");;
}
}