Skip to content

Instantly share code, notes, and snippets.

@myst404
Last active April 6, 2018 09:42
Show Gist options
  • Select an option

  • Save myst404/b5df243bd32ae616e18df781248ea1c3 to your computer and use it in GitHub Desktop.

Select an option

Save myst404/b5df243bd32ae616e18df781248ea1c3 to your computer and use it in GitHub Desktop.
Get subdomains from findsubdomains.com in Python (Aka the missing API)
#!/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