]> git.armaanb.net Git - phrases.git/blobdiff - extract.py
Finish basic form of program
[phrases.git] / extract.py
index a454569a2eebff59cb883c512b389bd7bb98434b..fa745300e64bdccdb8b1473f5bd4e218b8f8f57c 100755 (executable)
@@ -9,15 +9,13 @@ html = response.content
 
 soup = BeautifulSoup(html, "html.parser")
 list_table = soup.find_all("table", attrs={"class":"wikitable"})
-
-output = []
+f = open("phrases", "w")
 
 for table in list_table:
     for row in table.find_all("tr")[1:]:
+        f.write("%" )
         cell = row.find_all("td")
         for content in cell:
             text = content.get_text()
-            output.append(text)
-
-print(output)
-
+            f.write("\n" + text)
+f.close()