diff options
author | Julian Teu <julianteule@gmail.com> | 2018-04-10 18:07:28 +0200 |
---|---|---|
committer | Julian Teu <julianteule@gmail.com> | 2018-04-10 18:07:28 +0200 |
commit | 3e00fc23117a6fbb91d5ca09602f8006c3f2365a (patch) | |
tree | 4e3f2288424a5c09e9815eff04719f620cd7b321 /Scripts/wiki2P.py | |
parent | a3443fca6351cbe9ecbbe29a32e358f7534a92a6 (diff) |
Cleanup
Diffstat (limited to 'Scripts/wiki2P.py')
-rw-r--r-- | Scripts/wiki2P.py | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/Scripts/wiki2P.py b/Scripts/wiki2P.py deleted file mode 100644 index 316c7e9..0000000 --- a/Scripts/wiki2P.py +++ /dev/null @@ -1,46 +0,0 @@ -import requests, bs4, re - - - - -def calculate(site): - - print("Downloading wikipedia site: " + site) - - - res = requests.get("https://en.wikipedia.org" + site) - - print("Download completed analysing") - - soup = bs4.BeautifulSoup(res.text, "html.parser") - - - element = soup.find("div", {"class": "mw-content-ltr"}).find("p") - - - #print(element) - - elements = element.find_all("a") - - - - - pattern = re.compile("\/wiki\/(?!File|Help).*") - - results = "" - - - for i in elements: - if pattern.match(i["href"]) : - results = i["href"] - break - - return results - - - -siter = "/wiki/Linux" - -while siter is not "philosophy": - input(siter) - siter = calculate(siter) |