Skip to content

Instantly share code, notes, and snippets.

@mnuddindev
Created November 23, 2019 16:05
Show Gist options
  • Select an option

  • Save mnuddindev/4e7d0398cc5f4dead66f37e596c633bd to your computer and use it in GitHub Desktop.

Select an option

Save mnuddindev/4e7d0398cc5f4dead66f37e596c633bd to your computer and use it in GitHub Desktop.
import requests as r
from bs4 import BeautifulSoup
ip = open("ip.txt", "a+")
url = open("list.txt").read().split('\n')
print("[+] Script Started")
for i in url:
print(" | Getting Site URL from the List")
t = r.get(i)
html_soup = BeautifulSoup(t.text, 'html.parser')
print(" | Getting Source Code From the list\'s Websites")
try:
b = html_soup.find('div', attrs={
'id': 'ipv4-data'
})
a = b.find_all('a')
except AttributeError:
pass
else:
print(" | Getting Ip\'s From the ip Section")
for item in a:
item = item.get_text()
item = item.strip()
ip.write(item+'\n')
print("[-] Script Finished. Check the ip.txt file for Ip\'s")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment