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://www.g2.com/products/salesforce-salesforce-sales-cloud/reviews')
- # take screenshot
- driver.save_screenshot('blocked.png')
- driver.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement