#Todo
- attendance/home.html
- principal_home.html
- notice_view.html
- notice_home.html
- event.html
- department.html
- contact.html
- archive.html
- alumni.html
#Todo
import os | |
import re | |
from bs4 import BeautifulSoup | |
def get_files(): | |
folder = os.path.join(os.getcwd(), 'html') | |
names = [os.path.join(folder, i) for i in os.listdir(folder)] | |
names.sort() | |
return names |
#! /bin/bash | |
echo Creating directory | |
mkdir $1 | |
# copy standard project stuff | |
echo Copying License | |
lic=$1/LICENSE |
from requests import post | |
def save_page(html): | |
f = open('html/' + str(hash(html)), 'w') | |
f.write(html) | |
f.close() | |
def mark_done(roll): |
from bs4 import BeautifulSoup as BS | |
from urllib2 import urlopen | |
html = urlopen('https://in.pycon.org/cfp/pycon-india-2015/proposals/') | |
html = ''.join(html.readlines()) | |
html[:30] | |
soup = BS(html) | |
soup.find_all('div',{'class':'user-proposals'}) | |
proposals=soup.find_all('div',{'class':'user-proposals'}) | |
ordered = [] | |
for p in proposals: |
from time import time | |
# dummy functions | |
def html_minify(content, ignore_comments, parser): | |
"Constant time function" | |
return content | |
class Request: | |
def __init__(self): | |
self._hit_htmlmin = True |
class Primer: | |
def __init__(self, store_name='data'): | |
self.store_name = store_name | |
try: | |
fl = open(self.store_name, 'r') | |
fl.close() | |
except: | |
with open(self.store_name, 'w') as fl: | |
fl.write('2\n') |
Wrote profile results to testing.py.lprof | |
Timer unit: 1e-06 s | |
Total time: 18.9654 s | |
File: html2text/__init__.py | |
Function: optwrap at line 784 | |
Line # Hits Time Per Hit % Time Line Contents | |
============================================================== | |
784 @profile |
Wrote profile results to testing.py.lprof | |
Timer unit: 1e-06 s | |
Total time: 0.001185 s | |
File: html2text/__init__.py | |
Function: feed at line 121 | |
Line # Hits Time Per Hit % Time Line Contents | |
============================================================== | |
121 @profile |
import os | |
from requests import get | |
from hashlib import md5 | |
urls = ['http://ststephens.edu/', | |
'http://cmi.ac.in/'] | |
try: | |
with open('.website_signatures', 'r') as fl: |