Python Forum
ChromeDriver breaking Python script
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ChromeDriver breaking Python script
#2
The link to driver is now in a Json file JSON API endpoints last-known-good-versions-with-downloads.json.
Example.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
import time

# Setup
# https://storage.googleapis.com/chrome-for-testing-public/122.0.6261.128/win64/chromedriver-win64.zip
options = Options()
options.add_argument("--headless=new")
ser = Service(r"C:\cmder\bin\chromedriver.exe")
browser = webdriver.Chrome(service=ser, options=options)
# Parse or automation
url = 'https://www.python.org/'
browser.get(url)
python_about = browser.find_element(By.CSS_SELECTOR, '#touchnav-wrapper > header > div > div.introduction > p')
print(python_about.text)
Output:
Python is a programming language that lets you work quickly and integrate systems more effectively. Learn More
Reply


Messages In This Thread
RE: ChromeDriver breaking Python script - by snippsat - Mar-14-2024, 09:39 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,419 Jun-29-2023, 11:57 AM
Last Post: gologica
  Openpyxl module breaking my code EnderSM 5 1,143 May-26-2023, 07:26 PM
Last Post: snippsat
  breaking out of nested loops Skaperen 3 1,269 Jul-18-2022, 12:59 AM
Last Post: Skaperen
  Is chromedriver detectable by heavy seured websites? kolarmi19 4 1,547 Mar-29-2022, 08:14 PM
Last Post: Larz60+
  How to use += after breaking for loop? Frankduc 2 1,521 Dec-31-2021, 01:23 PM
Last Post: Frankduc
  How to fix while loop breaking off raphy11574 3 2,260 Oct-12-2021, 12:56 PM
Last Post: deanhystad
  breaking a large program into functions, not acting as expected Zane217 9 3,095 Sep-18-2021, 12:37 AM
Last Post: Zane217
  Need to run 100+ Chrome’s with Selenium but can’t get past ~15 without breaking imillz 0 1,398 Sep-04-2021, 04:51 PM
Last Post: imillz
Exclamation Help in breaking bytes into bits through masking and shifting kamui123 9 4,661 Jan-11-2021, 07:42 AM
Last Post: kamui123
  How to kill a bash script running as root from a python script? jc_lafleur 4 5,992 Jun-26-2020, 10:50 PM
Last Post: jc_lafleur

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020