GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Selenium/python at master · Decodo/Selenium

Expand file tree

/

python

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

python

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
README.md
README.md
 
 
example.py
example.py
 
 

README.md

Outline

Main Repository

Disclaimer

Selenium is a browser automation tool. This particular repository only covers Selenium setup for the Python programming language.

To continue further development with this tool, read the official Selenium documentation for Python.

Unfortunately, Selenium itself doesn't support username:password authentication for HTTP/HTTPs proxies; therefore, you'll need to have your IP whitelisted.

You can do that by following the guidelines listed here.

Prerequisites

  • Python
  • Selenium

Installation

Once you have all of the prerequisites ready, open the Terminal/Command Prompt window and create your project folder:

mkdir your_project

When the project directory is set up, you can download the script example.py:

  1. Navigate to the main directory of your project folder using cd your_project
  2. Download the script using the following command: curl https://raw.githubusercontent.com/Decodo/Selenium/master/python/example.py > example.py
image 3. Your project folder should now be populated with the *example.py* file.

Configuration

The only configuration required for the script are the values below:

HOSTNAME = ''
PORT = ''
DRIVER = ''

You can get the HOSTNAME and PORT information from the Decodo dashboard.

The configuration for the DRIVER value can be either 'CHROME' or 'FIREFOX'. This will determine if 'chromedriver' or 'geckodriver' will be installed and used during the process.

Usage

The script consists of two functions:

  • Decodo() – handles the proxy authentication;
  • webdriver_example() – installs the required drivers and gets a response from the target. In this case, the target is http://ip.decodo.com/.
browser.get('http://ip.decodo.com/')

Note that Chrome and Firefox have different attributes for proxy authentication; therefore, your requests should be similar to the following:

Firefox

browser = webdriver.Firefox(service=Service(GeckoDriverManager().install()), proxy=Decodo())

Chrome

browser = webdriver.Chrome(service=Service(ChromeDriverManager().install()), desired_capabilities=Decodo())

Testing

Before proceeding with the testing, you'll need to install the webdriver_manager using the command below:

pip3 install webdriver_manager

To run the script, simply execute the python3 example.py command while in your project's directory.

For machines running Windows, execute the python example.py command instead.

Need help?

Email - [email protected]
Live chat 24/7

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.