Update app.py
Browse files
app.py
CHANGED
|
@@ -16,14 +16,20 @@ def code(name):
|
|
| 16 |
|
| 17 |
|
| 18 |
heading_object=soup.find_all('div')
|
| 19 |
-
|
| 20 |
for info in heading_object:
|
| 21 |
info1 = str(info)
|
| 22 |
if '</script>' not in info1 and '<div class="w3-col l10 m12" id="main">' in info1:
|
| 23 |
|
| 24 |
#print(n)
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
|
| 29 |
|
|
|
|
| 16 |
|
| 17 |
|
| 18 |
heading_object=soup.find_all('div')
|
| 19 |
+
result = ""
|
| 20 |
for info in heading_object:
|
| 21 |
info1 = str(info)
|
| 22 |
if '</script>' not in info1 and '<div class="w3-col l10 m12" id="main">' in info1:
|
| 23 |
|
| 24 |
#print(n)
|
| 25 |
+
text = str(info.text).split('Next ❯')[1].split("❮ Previous")[0].split("\n\n\n")
|
| 26 |
+
#print(text)
|
| 27 |
+
for r in text:
|
| 28 |
+
if "Test Yourself With Exercises" in r or "Submit Answer »" in r or "On this page" in r:
|
| 29 |
+
continue
|
| 30 |
+
else:
|
| 31 |
+
result = result + r+"\n\n"
|
| 32 |
+
return result
|
| 33 |
|
| 34 |
|
| 35 |
|