Skip to content

Instantly share code, notes, and snippets.

@olto
Last active February 11, 2017 06:25
Show Gist options
  • Select an option

  • Save olto/e57eea4fb2557620dea020a80fb9db7d to your computer and use it in GitHub Desktop.

Select an option

Save olto/e57eea4fb2557620dea020a80fb9db7d to your computer and use it in GitHub Desktop.
Analyseur de Site Web
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os, sys
import time
#import requests
import socket
from bs4 import BeautifulSoup
print("")
print(" *******************************")
print(" Analyseur de Site Web...")
print(" A.S.W. by olto\n")
print(" " + time.strftime("%A %d %B %Y \n %H:%M:%S\n"))
print(" *******************************\n")
print("Entrez l'url du site à analyser (https://site.com) : \n")
page = requests.get(input(">>> "))
request = page.content
soup = BeautifulSoup(page.content, "html.parser")
pretiPage = soup.prettify()
listChild = soup.children
tag = [type(item) for item in list(soup.children)]
html = list(soup.children)[1]
listHtml = list(html.children)
body = list(html.children)[1]
head = list(html.children)[0]
p = list(body.children)[1]
txt = p.get_text()
linkAll = soup.find_all("a")
p = soup.find_all("p")
script = soup.find_all("script")
print(p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment