Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import webtech
# you can use options, same as from the command line
wt = webtech.WebTech(args=None)
# scan a single website
report = wt.start_from_url('https://google.com', timeout=1)
print(report)
# scan multiple websites from a list
for site in ['https://example.com', 'http://connectionerror']:
try:
report = wt.start_from_url(site, timeout=10)
print("Site: {}".format(site))
print(report)
except webtech.utils.ConnectionException:
print("Site unavailable: {}".format(site))
print("Done")
wt = webtech.WebTech(options={'json': True})
# scan a single website
report = wt.start_from_url('https://google.com', timeout=1)
print(report)
# scan multiple websites from a list
for site in ['https://shielder.it', 'http://connectionerror']:
try:
report = wt.start_from_url(site)
techs = report['tech']
print("Site: {}".format(site))
for tech in techs:
print(" - {}".format(tech))
except webtech.utils.ConnectionException:
print("Site unavailable: {}".format(site))
print("Done")