Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WryanBrock/e99811fbcf3487811ea3d2fbfdae8bc9 to your computer and use it in GitHub Desktop.
Save WryanBrock/e99811fbcf3487811ea3d2fbfdae8bc9 to your computer and use it in GitHub Desktop.
IE 11 Java Scraper Failing
package scraperBlocks;
import java.io.File;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.ie.InternetExplorerOptions;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
public class iescraper {
@SuppressWarnings("deprecation")
public static void main(String[] args) {
File ieFile = new File("C:\\Users\\seymo\\Desktop\\Projects\\Drivers\\IEDriverServer.exe");
System.setProperty("webdriver.ie.driver", ieFile.getAbsolutePath());
DesiredCapabilities ieCaps = DesiredCapabilities.internetExplorer();
WebDriver driver = new InternetExplorerDriver();
ieCaps.setCapability(InternetExplorerDriver.INITIAL_BROWSER_URL, "https://www.google.com/");
driver = new InternetExplorerDriver(ieCaps);
WebDriverWait wait = new WebDriverWait(driver, 100);
WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.name("q")));
element.clear();
WebElement selement = wait.until(ExpectedConditions.elementToBeClickable(By.name("q")));
selement.sendKeys("Ripon Al Wasim");
WebElement felement = wait.until(ExpectedConditions.elementToBeClickable(By.name("btnK")));
felement.click();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment