Every now and then I’m writing a small code to automate things with Python Selenium.
But seems like the above mentioned code changed in some way? I couldn’t find threads on here (that were actually useful) or in the internet.
I had this code working 8 months ago for instance:
from selenium.webdriver.common.keys import Keys
from selenium import webdriver
from time import sleep
import undetected_chromedriver as uc
from undetected_chromedriver.webelement import WebElement
Target = input("Please enter the target: ")
driver = uc.Chrome(use_subprocess=True)
driver.get('https://www.example.com')
sleep(15)
driver.get("https://www.example.com/login")
sleep(10)
...
Or this one from the internet doesn’t work as well:
from time import sleep
from selenium import webdriver
import undetected_chromedriver as uc
from selenium.webdriver.chrome.options import Options
options = uc.ChromeOptions()
options.headless = Falsedriver = uc.Chrome(options=options)
driver.get("https://google.com")
It says: <urlopen error [Errno 11001] getaddrinfo failed>
I tried changing the code a bit but my main goal is to load CF protected sites (or rather to bypass CF protection). I can open sites normally but not the above wanted way
D.Schulz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.