I am looking to retrieve data from a specific Russian gambling website using String information. Below is the code I have written for this purpose:
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import java.util.concurrent.TimeUnit;
public class Main {
public static void main(String[] args){
FirefoxOptions options = new FirefoxOptions();
String userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 OPR/60.0.3255.170";
System.setProperty("webdriver.gecko.driver","C:\\Users\\dbondarenko\\IdeaProjects\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
JavascriptExecutor js = (JavascriptExecutor)driver;
String baseUrl = "https://parimatch.com/ru/events/romania-iceland-6764586";
driver.get(baseUrl);
driver.manage().window().maximize();
driver.manage().timeouts().setScriptTimeout(20, TimeUnit.SECONDS);
String DomainName = js.executeScript("return document.domain;").toString();
System.out.println("Domain name of the site = " + DomainName);
String url = js.executeScript("return document.URL;").toString();
System.out.println("URL of the site = " + url);
String TitleName = js.executeScript("return document.title;").toString();
System.out.println("Title of the page = " + TitleName);
String innerText = js.executeScript(" return document.documentElement.innerText;").toString();
System.out.println("Inner text of the page = " + innerText);
js.executeScript("window.location = 'http://parimatch.com'");
}
}
The output I'm receiving contains some correct information, but it also includes many ellipsis signs instead of the exact output I need. Despite trying various solutions, I remain puzzled about how to resolve this issue. The page URL can be extracted from the code. Here is an example of my output:
Domain name of the site = parimatch.com
URL of the site = https://parimatch.com/ru/events/romania-iceland-6764586
Title of the page = Ставки на - . . . . - в БК Parimatch
JavaScript warning: https://parimatch.com/fpapi/s.js, line 1: WEBGL_debug_renderer_info is deprecated in Firefox and will be removed. Please use RENDERER.
JavaScript warning: https://parimatch.com/fpapi/s.js, line 1: WEBGL_debug_renderer_info is deprecated in Firefox and will be removed. Please use RENDERER.
JavaScript warning: https://promo.parimatch.com/api/adpool/static/adp.js, line 113: WEBGL_debug_renderer_info is deprecated in Firefox and will be removed. Please use RENDERER.
Inner text of the page = ...
...
...
...
...
...
...
Топ
Топ Экспрессы (and so on)