Last active
February 11, 2017 06:25
-
-
Save olto/e57eea4fb2557620dea020a80fb9db7d to your computer and use it in GitHub Desktop.
Analyseur de Site Web
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/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