Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # import required library
- import seleniumwire.undetected_chromedriver as UC
- # set Chrome Options
- chrome_options = uc.ChromeOptions()
- # define your proxy settings
- proxy_options = {
- 'proxy': {
- 'http': 'http://username:password@ip:port',
- 'https': 'https://username:password@ip:port'
- }
- }
- # initialize Chrome driver instance with specified proxy settings
- driver = uc.Chrome(
- options=chrome_options,
- seleniumwire_options=proxy_options
- )
- # navigate to target website
- driver.get('https://httpbin.io/ip')
- # retrieve the 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