Last active
April 6, 2018 09:42
-
-
Save myst404/b5df243bd32ae616e18df781248ea1c3 to your computer and use it in GitHub Desktop.
Get subdomains from findsubdomains.com in Python (Aka the missing API)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import requests | |
| import sys | |
| from bs4 import BeautifulSoup | |
| def main(): | |
| r = requests.get("https://findsubdomains.com/subdomains-of/" + str(sys.argv[1])) | |
| soup = BeautifulSoup(r.text, 'html.parser') | |
| tds = soup.find_all('td', attrs={'data-field': 'Domain'}) | |
| for td in tds: | |
| hrefs = td.find_all("a") | |
| for href in hrefs: | |
| print href.contents[0] | |
| if __name__ == "__main__": | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment