Using chromedriver-autoinstaller while restricted by a firewall

Can Chromedriver-autoinstaller be utilized behind a firewall?

Alternatively, are there more effective solutions for managing ChromeDriver while operating behind a firewall?

Answer №1

I encountered a problem which I resolved using webdriver manager in the following way:

import webdrivers
from viewport_manager.chrome import ChromeDriverManager
from viewport_manager.core.download_handler import WDMDownloadHandler
from viewport_manager.core.http import HttpClient
from webdrivers.chrome.service import Service
from webdrivers.viewer.ui import WebDriverWait
from webdrivers.locate.by import By
from requests import Response
import urllib3
import requests
import os
import time
os.environ['WDM_SSL_VERIFY'] = '0'
capabilities = webdrivers.SpecifiedCapabilities.CHROME
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

PROXY = "http:// *proxy address*"
opt = webdrivers.ChromeOptions()
opt.add_argument('--proxy-server=%s' % PROXY)
opt.add_argument("ignore-certificate-errors")
opt.add_argument(f'user-data-dir=C:\\Users\\ *Location of the Chrome profile*')

class CustomHttpClient(HttpClient):
    def get(self, url, params=None) -> Response:
        proxies={'http': 'http:// *proxy address*',
         'https': 'http:// *proxy address*',
         }
        return requests.get(url, params,proxies=proxies,verify=False)

http_client = CustomHttpClient()
download_handler = WDMDownloadHandler(http_client)


driver = webdrivers.Chrome(service=Service(ChromeDriverManager(download_handler=download_handler).install()),options=opt)

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Selenium kicks off from the user profile but encounters a crash when running in the terminal

from selenium import webdriver from selenium.webdriver.chrome.service import Service from webdriver_manager.chrome import ChromeDriverManager import time options = webdriver.ChromeOptions() options.add_argument("--profile-directory=Profile 2") o ...

Having difficulty accessing the VR Path Registry

Software Version: geckodriver-v0.20.0-win64 Operating System: Windows 10 Home Single Web Browser: Firefox: 59.0.2 (64-bits) Selenium Software: selenium-java-3.11.0 IDE: intelliJ Idea : 2018.1 Community Edition Greetings! I have recently started using We ...

Using Python to extract all the links on a dynamic webpage

I am struggling to develop a universal crawler that can analyze a webpage and compile a list of all links within it, with the goal of examining an entire domain and all its internal links. I have attempted using HtmlUnit in Java and Selenium in Python, bu ...

CSV: Determining the frequency of a specific string in a column based on the value in another column

I'm struggling with extracting specific information from a CSV file. Here is the structure of the data: bla country bla bla value Germany Y Germany Y Germany N Denmark N ...

Python's absence has been noted, thus rendering the script unable to be executed

Today, I encountered an issue while trying to run a Python script: python ./helloworld.py -bash: python: command not found Despite having Python installed on my computer: whereis python python: /usr/bin/python3.6 /usr/bin/python3.6m /usr/lib/python3.6 / ...

Experimenting with Selenium Webdriver to locate an input element by its name and input a specific value

I'm having trouble inputting a value in the final box. (Chassis Number) Here's what I've attempted: python from selenium import webdriver from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by imp ...

Struggling to find a specific element on a website with Xpath in Selenium using Python

Attempting to retrieve data from a website named: , specifically targeting the element: /html/body/div[1]/div/main/div/div[2]/div/div[2]/div/div/div[1]/div[4]/div[2]/div[1]/div[1]/div[2]/span[2] which displays volume as a number on the webpage. The code I ...

Create a single HTMLTestRunner file while executing multiple test classes

I've been struggling to configure HTMLTestRunner to consolidate output into a single file when running multiple test classes. Despite extensive research, I have not been successful in achieving this. Here is an example of my setup: class TestOne(uni ...

If I terminate the terminal from which I initiated the PostgreSQL population process, will it cause the process to stop running?

Recently, I created a database named 'enws' and have been using a Python script called 'db_store.py' to populate the DB with data from a file titled 'xSparse.txt'. As someone who is new to Linux and PostgreSQL, I'm curiou ...

Tips on utilizing json.tool in the command line to validate and format language files while preserving unicode characters

Ubuntu 16.04 Bash 4.4 python 3.5 After receiving a collection of language files from freelance translators on Upwork, it became evident that none of the files had matching line counts. To address this discrepancy, I decided to validate and format the ...

Using Selenium and Python to scrape text from a continuously refreshing webpage after each scroll

Currently, I am utilizing Selenium/python to automatically scroll down a social media platform and extract posts. At the moment, I am gathering all the text in one go after scrolling a set number of times (see code below), but my objective is to only gathe ...

Python: Retrieve the video streaming URL from a webpage

Is there a way to retrieve a video streaming link from a webpage? For instance, on Youtube and on the page http://www.youtube.com/watch?v=he5fpsmH_2g, extract the direct download link of the video and save it, similar to the functionality of VideoGet. A ...

Attempting to identify and automatically fill out a form using RSelenium

I am currently facing an issue with detecting and populating elements in an embedded form on my website using RSelenium. The form code is: <div id="form"> <form accept-charset="utf-8" method="POST" novalidate=""> ...

Finding a nested div within another div using text that is not tagged with XPath

I need help creating an XPath to select a div with the class "membername" using the parameter "Laura". <div class="label"> <div class="membername"></div> David </div> <div class="label"> < ...

Trouble with clicking the button in Selenium Webdriver? Element located but unable to be clicked

Can anyone assist me in finding a solution to my current problem? I have dedicated a significant portion of today trying various solutions both on this platform and through Google. To get straight to the point, I am facing an issue with Selenium automatio ...

How do I ensure that a button can only be clicked when valid values are entered using WebDriver?

I'm currently working on UI automation testing tasks in my job and one thing I am trying to figure out is how to handle a specific scenario. In the application, there is a form where users are required to enter their name and date of birth before the ...

What is the best way to change integers within a list to type int()?

I am working on a function that can evaluate mathematical expressions within a string. My approach involves first converting the string into a list. Initially, I attempted to convert the entire array into an array of integers. However, I encountered an is ...

Selenium can be inconsistent when it comes to sending send_keys

I'm currently working on a script to login to Facebook, search for a specific webpage using the search bar, and select the top result. However, there seems to be an issue with the script not always sending keys to the search bar and failing instead. A ...

Unable to launch web browser with RSelenium

I'm looking to utilize Selenium for web scraping in R. Operating System: Windows 11, version 21H2 I have updated Java to the latest version (1.8.0_351). Mentioning it as it may be a solution in these cases. However, I encounter an error when definin ...

Nodejs installation failure detected

I am dealing with a package node and I am looking to install it using the following command: ./configure --prefix=/path/NODEJS/node_installation && make && make install However, when I run this command, it returns the error below: File ...