Facebook
From selenium, 5 Years ago, written in Java.
Embed
Download Paste or View Raw
Hits: 331
  1. public static void Knorr(String maill) throws InterruptedException {
  2.         WebDriver firefox = new FirefoxDriver();
  3.         firefox.get("https://marketing.tr.netsalesmedia.pl/ts/i5036350/tsc?amc=dis.cubegroup.389902.403207.146737&tst=!!TIMESTAMP!!");
  4.         Thread.sleep(6000);
  5.         firefox.findElement(By.cssSelector(".button-right")).click();
  6.         Thread.sleep(2000);
  7.         firefox.findElement(By.cssSelector("div.agree-row:nth-child(5) > div:nth-child(1) > input:nth-child(1)")).click();
  8.         firefox.findElement(By.cssSelector("div.agree-row:nth-child(6) > div:nth-child(1) > input:nth-child(1)")).click();
  9.         firefox.findElement(By.cssSelector("div.agree-row:nth-child(7) > div:nth-child(1) > input:nth-child(1)")).click();
  10.         firefox.findElement(By.cssSelector("div.agree-row:nth-child(8) > div:nth-child(1) > input:nth-child(1)")).click();
  11.         Thread.sleep(1000);
  12.         firefox.findElement(By.xpath("/html/body/div[2]/div[2]/div/div/div/div[2]/div/div[3]/div/div/div/div/div[2]/div[8]/input")).sendKeys(maill); //W TEJ LINIJCE WYWALA BŁĄD
  13.         Thread.sleep(3000);
  14.         firefox.findElement(By.cssSelector(".download-ebook-button")).click();
  15.         Thread.sleep(6000);
  16.         firefox.close();
  17.     }
  18.  
  19.