Created
May 15, 2019 14:12
-
-
Save WryanBrock/e99811fbcf3487811ea3d2fbfdae8bc9 to your computer and use it in GitHub Desktop.
IE 11 Java Scraper Failing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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