summaryrefslogtreecommitdiff
path: root/Scripts/#wiki2P.py#
diff options
context:
space:
mode:
authorJulian <Julianteule@gmail.com>2017-02-01 10:38:02 +0100
committerJulian <Julianteule@gmail.com>2017-02-01 10:38:02 +0100
commit665aaa60c60e7cfb556b629edd74075c993d5bdf (patch)
treebefdcc80ae71176184e8c1add1aef4afe61691cf /Scripts/#wiki2P.py#
parent2eb28948556f464980cf4296c09d044c21bc84de (diff)
parentebed9571e58a560bca3d38c2a8ee644866e156ae (diff)
coolsad
Diffstat (limited to 'Scripts/#wiki2P.py#')
-rwxr-xr-xScripts/#wiki2P.py#26
1 files changed, 26 insertions, 0 deletions
diff --git a/Scripts/#wiki2P.py# b/Scripts/#wiki2P.py#
new file mode 100755
index 0000000..2fb1a10
--- /dev/null
+++ b/Scripts/#wiki2P.py#
@@ -0,0 +1,26 @@
+import requests, bs4, re
+
+# res = requests.get("https://en.wikipedia.org/wiki/Special:Random")
+res = requests.get("https://en.wikipedia.org/wiki/Linux")
+
+
+soup = bs4.BeautifulSoup(res.text, "html.parser")
+
+
+element = soup.select("#mw-content-text a[title]")
+
+
+pattern = re.compile("^\/.*")
+
+
+for i in element:
+ if "Edit section" not in i["title"] and pattern.match(i["href"]):
+ if "div" not in str(i.parent) and "th" not in str(i.parent) and "td" not in str(i.parent):
+ try:
+ i["class"]
+ except KeyError:
+ print(i)
+ break
+
+print("LOL")
+