From c8eb10a6e5a9be31ac703cf9efce6f40817760da Mon Sep 17 00:00:00 2001 From: Julian Date: Tue, 24 Jan 2017 18:46:34 +0100 Subject: Added more scripts --- Scripts/#wiki2P.py# | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 Scripts/#wiki2P.py# (limited to 'Scripts/#wiki2P.py#') 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") + -- cgit v1.2.3