sergueik@sergueik71:~$ X='A test ^_ $ ! this was'
sergueik@sergueik71:~$ Y=${X//[^a-zA-z0-9 ]/}
sergueik@sergueik71:~$ echo $Y
A test this was
public void test1() {
element = wait.until(ExpectedConditions.visibilityOfElementLocated(
By.xpath("//*[@id=\"content\"]//*[contains(text(),\"I Accept\")]")));
assertThat(element, notNullValue());
System.err.println("1: " + element.getText());
element.click();
element = wait.until(ExpectedConditions.visibilityOfElementLocated(By
.xpath("//*[@id=\"modal-manager\"]//*[contains(text(),\"Log in\")]")));
assertThat(element, notNullValue());
System.err.println("2: " + element.getAttribute("innerHTML"));
element.click();
element = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(
"//*[@id=\"modal-manager\"]//button[@aria-label=\"Log in with Facebook\"]")));
assertThat(element, notNullValue());
System.err.println("3: " + element.getAttribute("aria-label"));
element.click();
wait.until(ExpectedConditions.numberOfWindowsToBe(2));
System.err.println("5: oauth");
String parentWindow = driver.getWindowHandle();
Set<String> allWindows = driver.getWindowHandles();
for (String curWindow : allWindows) {
if (!parentWindow.equals(curWindow)) {
driver.switchTo().window(curWindow);
System.err.println("Title of the window" + driver.getTitle());
// Enter login and password
String loginPath = "//*[@id=\"email\"]";
String passPath = "//*[@id=\"pass\"]";
driver.findElement(By.xpath(loginPath)).sendKeys("xxxx");
// и т.д.
}
}
}
1:I ACCEPT
2: Log in
3: Log in with Facebook
5: oauth
<distributionManagement>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</distributionManagement>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2/</url>
</repository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
<properties>
<jprotractor.version>1.12-SNAPSHOT</jprotractor.version>
<dependency>
<groupId>com.github.sergueik.jprotractor</groupId>
<artifactId>jprotractor</artifactId>
<version>${jprotractor.version}</version>
<dependency>
<groupId>com.github.sergueik.jprotractor</groupId>
<artifactId>jprotractor</artifactId>
<version>${jprotractor.version}</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/jprotractor-${jprotractor.version}.jar</systemPath>
DISPLAY
был настроен как надоsudo netstat -anp | grep X
unix 2 [ ACC ] STREAM LISTENING 18721 1108/Xorg @/tmp/.X11-unix/X3
-display :3
sudo sh -c "lsof -U /tmp/.X11-unix/X3"
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
systemd 1594 sergueik 1u unix 0x00000000 0t0 19716 type=STREAM
systemd 1594 sergueik 2u unix 0x00000000 0t0 19716 type=STREAM
systemd 1594 sergueik 3u unix 0x00000000 0t0 19732 type=DGRAM
systemd 1594 sergueik 13u unix 0x00000000 0t0 19740 /run/user/1000/systemd/notify type=DGRAM
systemd 1594 sergueik 14u unix 0x00000000 0t0 19741 /run/user/1000/systemd/private type=STREAM
так что придется писать программу котораю просит и просит у ютюба еще ссылок и их извлекает и хранит
это наверняка потребует гораздо больше кода чем у вам пока написано