Advertisement
dereksir

Untitled

Mar 4th, 2024 (edited)
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. import undetected_chromedriver as uc
  2. from selenium.webdriver.common.by import By
  3.  
  4. # define proxy details
  5. proxy = '50.168.163.183:80'
  6.  
  7. # set Chrome options
  8. options = uc.ChromeOptions()
  9. # add proxy to Chrome options
  10. options.add_argument(f'--proxy-server={proxy}')
  11.  
  12. # intialize uc instance with configured options
  13. driver = uc.Chrome(options=options)
  14.  
  15. # navigate to target website
  16. driver.get('https://www.g2.com/products/salesforce-salesforce-sales-cloud/reviews')
  17.  
  18. # take screenshot
  19. driver.save_screenshot('blocked.png')
  20.  
  21. driver.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement