How to exchange python chrome selenium for Abu Cloud ip

import org.json.JSONException;
import org.json.JSONObject;
import org.openqa.selenium.Platform;
import org.openqa.selenium.Proxy;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;

import com.gargoylesoftware.htmlunit.DefaultCredentialsProvider;
import com.gargoylesoftware.htmlunit.WebClient;

public class FirefoxDriverProxyDemo
{
    // 
    final static String proxyUser = "H01234567890123D";
    final static String proxyPass = "0123456789012345";

    // 
    final static String proxyHost = "http-dyn.abuyun.com";
    final static int proxyPort = 9020;

    final static String firefoxBin = "D:/Program Files/Mozilla Firefox/firefox.exe";

    public static void main(String[] args) throws JSONException
    {
        System.setProperty("webdriver.firefox.bin", firefoxBin);

        FirefoxProfile profile = new FirefoxProfile();
        // 
        profile.setPreference("network.proxy.type", 1);
        // 
        profile.setPreference("network.proxy.http", proxyHost);
        profile.setPreference("network.proxy.http_port", proxyPort);

        profile.setPreference("network.proxy.ssl", proxyHost);
        profile.setPreference("network.proxy.ssl_port", proxyPort);

        profile.setPreference("username", proxyUser);
        profile.setPreference("password", proxyPass);

        // false
        profile.setPreference("network.proxy.share_proxy_settings", true);

        // localhostwebdriver
        profile.setPreference("network.proxy.no_proxies_on", "localhost");

        // firefox
        FirefoxDriver driver = new FirefoxDriver(profile);
    }
}                    

this is the request of firefox in java
https://www.abuyun.com/http-p.

Mar.19,2021
For more information on

python's selenium access documentation, please see https://www.abuyun.com/http-p.. Currently, chrome does not support headless mode using authentication agents.

Menu