一、我为什么要研究它?
1、全天候 7*24 自动监控收款,自动将即时到帐的交易反馈到网站接口或者数据库
2、轻松实现支付宝即时到账接口的功能,省去了人工一一对账再加款操作的麻烦
3、成功地解决了中、小企业及非企业支付,手续费昂贵等问题
最重要的是挑战自己
二、部分代码思路(有什么建议和意见欢迎交流q:1761067247)
System.setProperty("******", "*******");//交流
WebDriver webDriver = new ChromeDriver();
webDriver.get("https://auth.alipay.com/login/index.htm");
Thread.sleep(60000);
webDriver.manage().window().maximize();
// 拿到数据存数据库链接
String urls = "http://************/";
while (true) {
//此处交流讨论
if (rows.size() > 0) {
int num = rows.size() / 2;
for (int i = 1; i <= num; i++) {
Thread.sleep(500);
WebElement date = webDriver.findElement(By.xpath("(//tbody[@class='ant-table-tbody']/tr["
+ i + "])/td[@class=' ant-table-column-sort']/span[2]/span/span[1]"));
WebElement time = webDriver.findElement(By.xpath("(//tbody[@class='ant-table-tbody']/tr["
+ i + "])/td[@class=' ant-table-column-sort']/span[2]/span/span[2]"));
WebElement jiaoyi = webDriver.findElement(By.xpath("(//tbody[@class='ant-table-tbody']/tr["
+ i
+ "])/td[@class='paddingRight30___19-w2']/div/span/span[@class='displayText___R2YtL']"));
WebElement money = webDriver.findElement(
By.xpath("(//tbody[@class='ant-table-tbody']/tr[" + i + "])/td[5]/div/span/span"));
WebElement name = webDriver.findElement(
By.xpath("(//tbody[@class='ant-table-tbody']/tr[" + i + "])/td[4]/div/div[2]"));
WebElement userid = webDriver.findElement(
By.xpath("(//tbody[@class='ant-table-tbody']/tr[" + i + "])/td[4]/div/div[1]"));
System.out.println("dates=" + date.getText() + "×=" + time.getText() + "&trans="
+ jiaoyi.getAttribute("title") + "&userid=" + userid.getText() + "&money="
+ money.getText() + "&name=" + name.getText() + "");
/*
* commens.sendPost(urls, "dates=" + date.getText() + "×=" + time.getText()
* + "&trans=" + jiaoyi.getAttribute("title") + "&userid=" + userid.getText() +
* "&money=" + money.getText() + "&name=" + name.getText() + "");
*/
}
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
java.util.Date currentTime = new java.util.Date();
String now = formatter.format(currentTime);
System.out.print(now + "**s**");
}
} catch (Exception e) {
Thread.sleep(2000);
String a = webDriver.getCurrentUrl();
if (a.equals("https://www.alipay.com/")
|| a.equals("https://mbillexprod.alipay.com/enterprise/tradeListQuery.htm")) {
webDriver.navigate().to("https://mbillexprod.alipay.com/enterprise/fundAccountDetail.htm");
Thread.sleep(5000);
while (true) {
try {
Thread.sleep(15000);
webDriver.navigate()
.to("https://mbillexprod.alipay.com/enterprise/fundAccountDetail.htm");
Thread.sleep(15000);
String currentUrl22 = webDriver.getCurrentUrl();
if (currentUrl22
.equals("https://mbillexprod.alipay.com/enterprise/fundAccountDetail.htm")) {
Thread.sleep(15000);
WebElement day301 = webDriver.findElement(
By.xpath("(//div[@class='quickTimeSelectWrapper___1nv7h']/div[4])"));
day301.click();
Thread.sleep(15000);
WebElement shouru = webDriver
.findElement(By.xpath("(//div[@class='ant-tabs-nav-scroll']/div/div[3])"));
shouru.click();
Thread.sleep(15000);
WebElement table2 = webDriver
.findElement(By.xpath("(//div[@class='ant-table-body']/table)"));
List
if (rows2.size() > 0) {
int num2 = rows2.size() / 2;
for (int i = 1; i <= num2; i++) {
WebElement date = webDriver
.findElement(By.xpath("(//tbody[@class='ant-table-tbody']/tr[" + i
+ "])/td[@class=' ant-table-column-sort']/span[2]/span/span[1]"));
WebElement time = webDriver
.findElement(By.xpath("(//tbody[@class='ant-table-tbody']/tr[" + i
+ "])/td[@class=' ant-table-column-sort']/span[2]/span/span[2]"));
WebElement jiaoyi = webDriver
.findElement(By.xpath("(//tbody[@class='ant-table-tbody']/tr[" + i
+ "])/td[2]/div/div/span/span[@class='displayText___R2YtL']"));
WebElement userid = webDriver
.findElement(By.xpath("(//tbody[@class='ant-table-tbody']/tr[" + i
+ "])/td[4]/div/div[1]"));
WebElement name = webDriver
.findElement(By.xpath("(//tbody[@class='ant-table-tbody']/tr[" + i
+ "])/td[4]/div/div[2]"));
WebElement money = webDriver
.findElement(By.xpath("(//tbody[@class='ant-table-tbody']/tr[" + i
+ "])/td[6]/div/span"));
System.out.println("dates=" + date.getText() + "×=" + time.getText()
+ "&trans=" + jiaoyi.getAttribute("title") + "&userid="
+ userid.getText() + "&money=" + money.getText() + "&name="
+ name.getText() + "");
/*
* commens.sendPost(urls, "dates=" + date.getText() + "×=" +
* time.getText() + "&trans=" + jiaoyi.getAttribute("title") + "&userid=" +
* userid.getText() + "&money=" + money.getText() + "&name=" +
* name.getText() + "");
*/
}
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
java.util.Date currentTime = new java.util.Date();
String now = formatter.format(currentTime);
System.out.print(now + "**d***");
}
}
} catch (Exception e1) {
webDriver.close();
webDriver.quit();
}
}
}
}
} else {
webDriver.navigate().to("https://mbillexprod.alipay.com/enterprise/fundAccountDetail.htm");
Thread.sleep(5000);
while (true) {
try {
Thread.sleep(15000);
webDriver.navigate().to("https://mbillexprod.alipay.com/enterprise/fundAccountDetail.htm");
Thread.sleep(15000);
String currentUrl22 = webDriver.getCurrentUrl();
if (currentUrl22.equals("https://mbillexprod.alipay.com/enterprise/fundAccountDetail.htm")) {
Thread.sleep(15000);
WebElement day301 = webDriver
.findElement(By.xpath("(//div[@class='quickTimeSelectWrapper___1nv7h']/div[4])"));
day301.click();
Thread.sleep(15000);
WebElement shouru = webDriver
.findElement(By.xpath("(//div[@class='ant-tabs-nav-scroll']/div/div[3])"));
shouru.click();
Thread.sleep(15000);
WebElement table2 = webDriver
.findElement(By.xpath("(//div[@class='ant-table-body']/table)"));
List
if (rows2.size() > 0) {
int num2 = rows2.size() / 2;
for (int i = 1; i <= num2; i++) {
WebElement date = webDriver
.findElement(By.xpath("(//tbody[@class='ant-table-tbody']/tr[" + i
+ "])/td[@class=' ant-table-column-sort']/span[2]/span/span[1]"));
WebElement time = webDriver
.findElement(By.xpath("(//tbody[@class='ant-table-tbody']/tr[" + i
+ "])/td[@class=' ant-table-column-sort']/span[2]/span/span[2]"));
WebElement jiaoyi = webDriver
.findElement(By.xpath("(//tbody[@class='ant-table-tbody']/tr[" + i
+ "])/td[2]/div/div/span/span[@class='displayText___R2YtL']"));
WebElement userid = webDriver.findElement(By.xpath(
"(//tbody[@class='ant-table-tbody']/tr[" + i + "])/td[4]/div/div[1]"));
WebElement name = webDriver.findElement(By.xpath(
"(//tbody[@class='ant-table-tbody']/tr[" + i + "])/td[4]/div/div[2]"));
WebElement money = webDriver.findElement(By
.xpath("(//tbody[@class='ant-table-tbody']/tr[" + i + "])/td[6]/div/span"));
System.out.println("dates=" + date.getText() + "×=" + time.getText()
+ "&trans=" + jiaoyi.getAttribute("title") + "&userid=" + userid.getText()
+ "&money=" + money.getText() + "&name=" + name.getText() + "");
/*
* commens.sendPost(urls, "dates=" + date.getText() + "×=" + time.getText()
* + "&trans=" + jiaoyi.getAttribute("title") + "&userid=" + userid.getText() +
* "&money=" + money.getText() + "&name=" + name.getText() + "");
*/
}
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
java.util.Date currentTime = new java.util.Date();
String now = formatter.format(currentTime);
System.out.print(now + "**d***");
}
}
} catch (Exception e) {
webDriver.close();
webDriver.quit();
}
}
}
}
}
三、效果图,本人感觉效果不错(有什么建议和意见欢迎来提交流q:1761067247)