Follow the link with Selenium (Java)

This is a sample that follows the link in Selenium. I wrote the following program in Java. Follow the link with Selenium (Python)

follow_link.java


// -----------------------------------------------------------------------
/*
	follow_link.java

				Sep/21/2018
*/
// ----------------------------------------------------------------------- 
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.By;
 
public class follow_link {
 
// ----------------------------------------------------------------------- 
public static void main(String[] args) {
	System.err.println ("***start***");

	String url = "https://ekzemplaro.org";

	WebDriver driver = new FirefoxDriver();
	driver.get(url);

	WebElement tag = driver.findElement(By.id("ekzemplaro"));

	tag.click();

	tag = driver.findElement(By.linkText("English"));

	tag.click();

	System.err.println ("***End***");
}

// ----------------------------------------------------------------------- 
}

// ----------------------------------------------------------------------- 

Makefile


follow_link.class: follow_link.java
	javac follow_link.java -cp ./client-combined-3.14.0.jar 
clean:
	rm -f follow_link.class

Execution method

export CLASSPATH=.:./client-combined-3.14.0.jar:./guava-26.0-jre.jar:./okhttp-3.11.0.jar:./okio-2.0.0.jar:./kotlin-stdlib-1.2.60.jar:./commons-exec-1.3.jar
#
java follow_link

Recommended Posts

Follow the link with Selenium (Java)
Follow the Datomic tutorial with Datascript
Link Java and C ++ code with SWIG
Read xlsx file in Java with Selenium
Try using the Wii remote with Java
[Java] Get the date with the LocalDateTime class
Selenium sample (Java)
Selenium x Java
[Java] Set the time from the browser with jsoup
Understanding the MVC framework with server-side Java 1/4 View
Try to link Ruby and Java with Dapr
Understanding the MVC framework with server-side Java 3/4 Controller
[Swift] How to link the app with Firebase
Build an E2E test environment with Selenium (Java)
Calculate the similarity score of strings with JAVA
Java starting with JShell-A peek into the Java world
Understanding the MVC framework with server-side Java 2/4 Model
Install java with Homebrew
Trace the SQL executed with the application Insights java agent
CI the architecture of Java / Kotlin applications with ArchUnit
Install Java with Ansible
Comfortable download with JAVA
Monitor the internal state of Java programs with Kubernetes
Check the behavior of Java Intrinsic Locks with bpftrace
Switch java with direnv
[Java] Get the date 10 days later with the Calendar class
[Java] Get the file path in the folder with List
HTTPS connection with Java to the self-signed certificate server
[LeJOS] Let's remotely control the EV3 motor with Java
Download Java with Ansible
Java development link summary
Prepare the environment for java11 and javaFx with Ubuntu 18.4
Let's scrape with Java! !!
Build Java with Wercker
The story of making dto, dao-like with java, sqlite
Java desktop with the same front end as the WEB.
Replace only part of the URL host with java
Get started with serverless Java with the lightweight framework Micronaut!
Endian conversion with JAVA
[Java] Change the process according to the situation with the Strategy pattern
Only the top level Stream can be parallelized with Java Stream.
Find the address class and address type from the IP address with Java
Enhanced Java compilation errors with the static analysis tool ErrorProne
[Java] Simplify the implementation of data history management with Reladomo
[Java] [Play Framework] Until the project is started with Gradle
[Java] Check the difference between orElse and orElseGet with IntStream
About the behavior when doing a file map with java
Be sure to compare the result of Java compareTo with 0
Find the greatest common divisor and least common multiple with JAVA
I tried using the CameraX library with Android Java Fragment
Easy BDD with (Java) Spectrum?
Use Lambda Layers with Java
Getting Started with Java Collection
Java Config with Spring MVC
Basic Authentication with Java 11 HttpClient
Let's experiment with Java inlining
Run batch with docker-compose with Java batch
[Template] MySQL connection with Java
Rewrite Java try-catch with Optional
Install Java 7 with Homebrew (cask)
[Java] JSON communication with jackson