Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about api functionality #109

Open
iGabyTM opened this issue Jul 12, 2023 · 0 comments
Open

Question about api functionality #109

iGabyTM opened this issue Jul 12, 2023 · 0 comments

Comments

@iGabyTM
Copy link

iGabyTM commented Jul 12, 2023

I'm trying to make a similar project, because I need it made with java and different data, but I can not get past cloudflare verification. I use selenium and chrome driver, with the following options:

private static final String USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36";

final var options = new ChromeOptions();

if (headless) {
    options.addArguments("--headless");
}

options.addArguments(
        "--disable-blink-features=AutomationControlled",
        "--disable-geolocation",
        "--user-agent=" + USER_AGENT
);
options.setExperimentalOption("excludeSwitches", List.of("enable-automation"));
options.setCapability(CapabilityType.PLATFORM_NAME, Pkatform.WINDOWS);
final var driver = new ChromeDriver(options);
driver.executeScript("Object.defineProperty(navigator, 'webdriver', {get: () => undefined})");
driver.manage().window().maximize();
return driver;

I've looked at the code of your lib and I couldn't really find anything about hiding the webdriver, and yet your code works just fine xD
The extra data I need is from https://www.hltv.org/betting/analytics/<match id>, I wonder if they have extra protection for that page, because the match page loads just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant