NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

package test1;

import java.io.File;
import java.io.FileOutputStream;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.junit.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.events.EventFiringWebDriver;

import com.google.common.base.Verify;

public class test1 {

private static XSSFWorkbook workbook;
public static void main(String[] args) throws InterruptedException {

int i1 = 3;


WebElement imaginaryMouseLocationaltüst;
String SonVeri = "";

WebDriver driver;
driver = new FirefoxDriver();
driver.get("http://www.oddsportal.com/soccer/europe/champions-league-2015-2016/real-madrid-manchester-city-dhJZn1pn/#1X2;2");


driver.findElement(By.xpath("//*[@id='user-header-timezone-expander']")).click();
Thread.sleep(500L);

driver.findElement(By.xpath("//*[@id='timezone-content']/a[5]/span")).click();
Thread.sleep(500L);

driver.findElement(By.xpath("//*[@id='user-header-oddsformat-expander']")).click();
Thread.sleep(500L);

driver.findElement(By.xpath("//*[@id='user-header-oddsformat']/li[1]/a")).click();
Thread.sleep(500L);


driver.findElement(By.xpath("//*[@id='bettype-tabs']/ul/li[5]")).click();
Thread.sleep(500L);


driver.findElement(By.linkText("Over/Under +0.5")).click();
Thread.sleep(500L);

for (i1 = 3; i1 < 5; i1++) {
try {
Actions oranlaraltüst05 = new Actions(driver);
imaginaryMouseLocationaltüst = driver.findElement(By.xpath("//*[@id='odds-data-table']/div[1]/table/tbody/tr[3]/td["+i1+"]/div"));

oranlaraltüst05.moveToElement(imaginaryMouseLocationaltüst);
oranlaraltüst05.perform();
Thread.sleep(500L);
List<WebElement> oranaltüst05 = driver.findElements(By.xpath("//*[@id='tooltiptext']/strong"));
if (oranaltüst05.size() == 2) {
SonVeri = SonVeri + oranaltüst05.get(1).getText() + "-";
} else {
SonVeri = SonVeri + oranaltüst05.get(0).getText() + "-";
}

}catch(Exception e){
}
}
i1++;

driver.findElement(By.linkText("Over/Under +0.5")).click();
Thread.sleep(500L);

driver.findElement(By.linkText("Over/Under +1.5")).click();
Thread.sleep(500L);

for (i1 = 3; i1 < 5; i1++) {
try{

Actions oranlaraltüst15 = new Actions(driver);
imaginaryMouseLocationaltüst = driver.findElement(By.xpath("//*[@id='odds-data-table']/div[6]/table/tbody/tr[4]/td["+i1+"]/div"));

oranlaraltüst15.moveToElement(imaginaryMouseLocationaltüst);
oranlaraltüst15.perform();
Thread.sleep(500L);
List<WebElement> oranaltüst15 = driver.findElements(By.xpath("//*[@id='tooltiptext']/strong"));
if (oranaltüst15.size() == 2) {
SonVeri = SonVeri + oranaltüst15.get(1).getText() + "-";
} else {
SonVeri = SonVeri + oranaltüst15.get(0).getText() + "-";
}

}catch(Exception e){
}
}
i1++;

driver.findElement(By.linkText("Over/Under +1.5")).click();
Thread.sleep(500L);

driver.findElement(By.linkText("Over/Under +2.5")).click();
Thread.sleep(500L);

for (i1 = 3; i1 < 5; i1++) {
try{

Actions oranlaraltüst25 = new Actions(driver);
imaginaryMouseLocationaltüst = driver.findElement(By.xpath("//*[@id='odds-data-table']/div[11]/table/tbody/tr[6]/td["+i1+"]/div"));

oranlaraltüst25.moveToElement(imaginaryMouseLocationaltüst);
oranlaraltüst25.perform();
Thread.sleep(500L);
List<WebElement> oranaltüst25 = driver.findElements(By.xpath("//*[@id='tooltiptext']/strong"));
if (oranaltüst25.size() == 2) {
SonVeri = SonVeri + oranaltüst25.get(1).getText() + "-";
} else {
SonVeri = SonVeri + oranaltüst25.get(0).getText() + "-";
}

}catch(Exception e){
}
}
i1++;
driver.findElement(By.linkText("Over/Under +2.5")).click();
Thread.sleep(500L);

driver.findElement(By.linkText("Over/Under +3.5")).click();
Thread.sleep(500L);

for (i1 = 3; i1 < 5; i1++) {
try{

Actions oranlaraltüst35 = new Actions(driver);
imaginaryMouseLocationaltüst = driver.findElement(By.xpath("//*[@id='odds-data-table']/div[18]/table/tbody/tr[4]/td["+i1+"]/div"));

oranlaraltüst35.moveToElement(imaginaryMouseLocationaltüst);
oranlaraltüst35.perform();
Thread.sleep(500L);
List<WebElement> oranaltüst35 = driver.findElements(By.xpath("//*[@id='tooltiptext']/strong"));
if (oranaltüst35.size() == 2) {
SonVeri = SonVeri + oranaltüst35.get(1).getText() + "-";
} else {
SonVeri = SonVeri + oranaltüst35.get(0).getText() + "-";
}

}catch(Exception e){
}
}
i1++;

driver.findElement(By.linkText("Over/Under +3.5")).click();
Thread.sleep(500L);

driver.findElement(By.linkText("Over/Under +4.5")).click();
Thread.sleep(500L);

for (i1 = 3; i1 < 5; i1++) {
try{

Actions oranlaraltüst45 = new Actions(driver);
imaginaryMouseLocationaltüst = driver.findElement(By.xpath("//*[@id='odds-data-table']/div[23]/table/tbody/tr[4]/td["+i1+"]/div"));

oranlaraltüst45.moveToElement(imaginaryMouseLocationaltüst);
oranlaraltüst45.perform();
Thread.sleep(500L);
List<WebElement> oranaltüst45 = driver.findElements(By.xpath("//*[@id='tooltiptext']/strong"));
if (oranaltüst45.size() == 2) {
SonVeri = SonVeri + oranaltüst45.get(1).getText() + "-";
} else {
SonVeri = SonVeri + oranaltüst45.get(0).getText() + "-";
}

}catch(Exception e){
}
}
i1++;

driver.findElement(By.linkText("Over/Under +4.5")).click();
Thread.sleep(500L);

driver.findElement(By.linkText("Over/Under +5.5")).click();
Thread.sleep(500L);

for (i1 = 3; i1 < 5; i1++) {
try{

Actions oranlaraltüst55 = new Actions(driver);
imaginaryMouseLocationaltüst = driver.findElement(By.xpath("//*[@id='odds-data-table']/div[28]/table/tbody/tr[4]/td["+i1+"]/div"));

oranlaraltüst55.moveToElement(imaginaryMouseLocationaltüst);
oranlaraltüst55.perform();
Thread.sleep(500L);
List<WebElement> oranaltüst55 = driver.findElements(By.xpath("//*[@id='tooltiptext']/strong"));
if (oranaltüst55.size() == 2) {
SonVeri = SonVeri + oranaltüst55.get(1).getText() + "-";
} else {
SonVeri = SonVeri + oranaltüst55.get(0).getText() + "-";
}

}catch(Exception e){
}
}
i1++;

driver.findElement(By.linkText("Over/Under +5.5")).click();
Thread.sleep(500L);

driver.findElement(By.linkText("Over/Under +6.5")).click();
Thread.sleep(500L);

for (i1 = 3; i1 < 5; i1++) {
try{

Actions oranlaraltüst65 = new Actions(driver);
imaginaryMouseLocationaltüst = driver.findElement(By.xpath("//*[@id='odds-data-table']/div[32]/table/tbody/tr[3]/td["+i1+"]/div"));

oranlaraltüst65.moveToElement(imaginaryMouseLocationaltüst);
oranlaraltüst65.perform();
Thread.sleep(500L);
List<WebElement> oranaltüst65 = driver.findElements(By.xpath("//*[@id='tooltiptext']/strong"));
if (oranaltüst65.size() == 2) {
SonVeri = SonVeri + oranaltüst65.get(1).getText() + "-";
} else {
SonVeri = SonVeri + oranaltüst65.get(0).getText() + "-";
}

}catch(Exception e){
}
}

driver.findElement(By.linkText("Over/Under +6.5")).click();
Thread.sleep(500L);

workbook = new XSSFWorkbook();
XSSFSheet sheet = workbook.createSheet("Employee Data");
Map<String, Object[]> data = new TreeMap<String, Object[]>();
String[] array = SonVeri.split("-");


data.put("1",
new Object[] { array[0], array[1], array[2], array[3], array[4], array[5], array[6], array[7], array[8], array[9], array[10], array[11], array[12], array[13] });


Set<String> keyset = data.keySet();
int rownum = 0;
for (String key : keyset) {
Row row = sheet.createRow(rownum++);
Object[] objArr = data.get(key);
int cellnum = 0;
for (Object obj : objArr) {
Cell cell = row.createCell(cellnum++);
if (obj instanceof String)
cell.setCellValue((String) obj);
else if (obj instanceof Integer)
cell.setCellValue((Integer) obj);
}
}
try {
// Write the workbook in file system
FileOutputStream out = new FileOutputStream(new File("howtodoinjava_demo.xlsx"));
workbook.write(out);
out.close();
System.out.println("howtodoinjava_demo.xlsx written successfully on disk.");

} catch (Exception e) {
e.printStackTrace();
}
driver.quit();
}
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.