Skip to content

Commit

Permalink
Added proxy support to HeadlessBrowser()
Browse files Browse the repository at this point in the history
  • Loading branch information
elceef committed Oct 31, 2023
1 parent c37a09e commit 6b631f9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dnstwist.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,10 @@ def __init__(self, useragent=None):
chrome_options = webdriver.ChromeOptions()
for opt in self.WEBDRIVER_ARGUMENTS:
chrome_options.add_argument(opt)
proxies = urllib.request.getproxies()
if proxies:
proxy_string = ';'.join(['{}={}'.format(scheme, url) for scheme, url in proxies.items()])
chrome_options.add_argument('--proxy-server={}'.format(proxy_string))
chrome_options.add_experimental_option('excludeSwitches', ['enable-automation'])
chrome_options.add_experimental_option('useAutomationExtension', False)
self.driver = webdriver.Chrome(options=chrome_options)
Expand Down

0 comments on commit 6b631f9

Please sign in to comment.