Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import undetected_chromedriver as uc
- from selenium.webdriver.common.by import By
- # define proxy details
- PROXY = '50.168.163.183:80'
- # set Chrome options
- options = uc.ChromeOptions()
- # add proxy to Chrome options
- options.add_argument(f'--proxy-server={PROXY}')
- # intialize uc instance with configured options
- driver = uc.Chrome(options=options)
- # navigate to target website
- driver.get('https://httpbin.io/ip')
- # retrieve text content of the page
- textContent = driver.find_element(By.TAG_NAME, 'body').text
- print(textContent)
- driver.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement