0.0% ≤ diff ≤ 16.0%

14 clusters, 43 submissions

all: cluster #1 (2)

# 6231003421 (2020-10-18 14:24) %diff = 0.0 67% def get_faculty_names(url): faculty_names=[] html=load_html(url) x = html.find('Faculty') y = html.find('</a>',x) while True: faculty_names.append(html[x:y]) x = html.find('Faculty',y) if x == -1: break y = html.find('</a>', x) return faculty_names[:-1] def download_faculty_images(url): html = load_html(url) x = html.find('post-media') x = html.find('1024w,',x) x+=5 y= html.find('300w',x) while True: #print(html[x:y].split()[-1]) fname = html[x:y].split('/')[-1] if 'faculty' in fname.split('-'): save_image(html[x:y].split()[-1],fname) x = html.find('post-media',y ) if x == -1: break x = html.find('1024w,',x ) x +=5 y = html.find('300w',x ) def print_faculty_numbers(url): html = load_html(url) x = html.find('post-media') x = html.find('href="',x) x+= 6 y= html.find('"',x) while True: link = html[x:y] name = link.split('/')[-1].split('.')[0][:-25] if name.split('-')[0]=='faculty': print(name) html2 = load_html(link) z = html2.find('Contact</strong>') z = html2.find('+66',z) q = html2.find('<br>',z) temp = html2[z:q].split() phone='' for momo in temp: if phone =='': if '-' in momo: temp1=momo.split('-') if '+66' in temp1: temp1.replace('+66','0') phone+=' '.join(temp1) else: phone+='0 ' elif len(momo)==4 and len(phone) <=11: phone+=momo+' ' elif len(phone)>11: break print(phone.strip()) x = html.find('post-media',y) if x == -1: break x = html.find('href="',x) x+= 6 y= html.find('"',x) def save_image(img_url, filename): img = urq.urlopen(img_url) fname = open(filename,'wb') fname.write(img.read()) fname.close() #-------------------------------------------------# 6331413121 (2020-10-18 17:11) %diff = 0.0 67% def get_faculty_names(url): faculty_names=[] html=load_html(url) i=html.find('Faculty') j=html.find('</a>',i) while True: faculty_names.append(html[i:j]) i=html.find('Faculty',j) if i==-1: break j=html.find('</a>',i) return faculty_names[:-1] def download_faculty_images(url): html=load_html(url) i=html.find('post-media') i=html.find('1024w,',i) i+=5 j=html.find('300w',i) while True: #print(html[i:j].split()[-1]) fname=html[i:j].split('/')[-1] if 'faculty' in fname.split('-'): save_image(html[i:j].split()[-1],fname) i=html.find('post-media',j) if i == -1: break i=html.find('1024w,',i) i+=5 j=html.find('300w',i) def print_faculty_numbers(url): html=load_html(url) i=html.find('post-media') i=html.find('href="',i) i+=6 j=html.find('"',i) while True: link=html[i:j] name=link.split('/')[-1].split('.')[0][:-25] if name.split('-')[0]=='faculty': print(name) html2=load_html(link) k=html2.find('Contact</strong>') k=html2.find('+66',k) l=html2.find('<br>',k) temp=html2[k:l].split() phone='' for e in temp: if phone =='': if '-' in e: temp1=e.split('-') if '+66' in temp1: temp1.replace('+66','0') phone+=' '.join(temp1) else: phone+='0 ' elif len(e)==4 and len(phone) <=11: phone+=e+' ' elif len(phone)>11: break print(phone.strip()) i=html.find('post-media',j) if i == -1: break i=html.find('href="',i) i+=6 j=html.find('"',i) #------------------------------------------------- def save_image(img_url, filename): img=urq.urlopen(img_url) fname=open(filename,'wb') fname.write(img.read()) fname.close()

all: cluster #2 (2)

# 6331137021 (2020-10-18 00:46) %diff = 0.0 42% def get_faculty_names(url): html = load_html(url) pattern1 = "\"post-entry\">" pattern2 = "<a href=" i = html.find(pattern1) num=0 result = [] if i >=0 : j=html.find(pattern2,i) i=html.find(">",j) j=html.find("<",i) result.append(html[i+1:j]) while i !=-1 : i = html.find(pattern1,j) if i >=0 : j=html.find(pattern2,i) i=html.find(">",j) j=html.find("<",i) if html[i+1:i+8] == "Faculty": result.append((html[i+1:j])) num+=1 return result def download_faculty_images(url): html = load_html(url) a = get_amount_of_faculties(url) b = 1 pattern1 = "post-media" pattern2 = "img" pattern3 = "data-src" pattern4 = "data-srcset" pattern5 = "1024w" pattern6 = "300w" i = html.find(pattern1) if i >=0 : j=html.find(pattern2,i) #print(j) i=html.find(pattern3,j) j=html.find(pattern4,i) i=html.find(pattern5,j) j=html.find(pattern6,i) pic = html[i:j] pos1_pic = pic.find("https://") pos2_pic = pic.find(" 300w") image_url = pic[pos1_pic:pos2_pic] pos3_pic = pic.find("/image/") pos4_pic = pic.find(".jpg") filename = pic[pos3_pic+7:pos4_pic] save_image(image_url,filename) while b < a: i = html.find(pattern1,j) if i >=0 : j=html.find(pattern2,i) #print(j) i=html.find(pattern3,j) j=html.find(pattern4,i) i=html.find(pattern5,j) j=html.find(pattern6,i) pic = html[i:j] pos1_pic = pic.find("https://") pos2_pic = pic.find(" 300w") image_url = pic[pos1_pic:pos2_pic] pos3_pic = pic.find("/image/") pos4_pic = pic.find(".jpg") filename = pic[pos3_pic+7:pos4_pic] save_image(image_url,filename) #print(faculty_image) b+=1 pass def print_faculty_numbers(url): a = get_amount_of_faculties(url) html = load_html(url) pattern1 = "post-entry" pattern2 = "<a href=" pattern3 = "data-src" pattern4 = "data-srcset" Tel_No = [] i = html.find(pattern1) if i >=0 : num=1 j=html.find(pattern2,i) i=html.find(">",j) url2 = html[j+9:i-1] print(url2[27:-5]) i1 = url2.find("academic") j1 = url2.find("/") html2 = str(urq.urlopen(url2).read().decode('utf-8')) p1 = "Tel:" i1=html2.find("Tel:") if i1>=0 : j1=html2.find("+66",i1) i1=html2.find("<",j1) tel=html2[j1:i1] tel=tel.split() for i in range(len(tel)) : if tel[i]=="+66" : Tel_No.append("0") elif tel[i][-1] =="," : Tel_No.append(tel[i][0:-1]) else : Tel_No.append(tel[i]) print(" ".join(Tel_No[0:3])) i1=j1=0 while num <a : Tel_No=[] num+=1 i=html.find(pattern1,j) j=html.find(pattern2,i) i=html.find(">",j) url2 = html[j+9:i-1] print(url2[27:-5]) html2 = str(urq.urlopen(url2).read().decode('utf-8')) p1 = "Tel:" i1=html2.find(p1) if i1>=0 : j1=html2.find("+66",i1) i1=html2.find("<",j1) tel=html2[j1:i1] tel=tel.split() for i in range(len(tel)) : if tel[i]=="+66" : Tel_No.append("0") elif tel[i][-1] =="," : Tel_No.append(tel[i][0:-1]) else : Tel_No.append(tel[i]) print(" ".join(Tel_No[0:3])) i1=j1=0 #------------------------------------------------- def save_image(img_url, filename): d = urq.urlopen(img_url) l = open(filename+".jpg","wb") l.write(d.read()) l.close() pass def get_amount_of_faculties(url): a = get_faculty_names(url) return len(a)# 6331113921 (2020-10-18 23:20) %diff = 0.0 42% def get_faculty_names(url): html = load_html(url) pattern1 = "\"post-entry\">" pattern2 = "<a href=" i = html.find(pattern1) num=0 result = [] if i >=0 : j=html.find(pattern2,i) i=html.find(">",j) j=html.find("<",i) result.append(html[i+1:j]) while i !=-1 : i = html.find(pattern1,j) if i >=0 : j=html.find(pattern2,i) i=html.find(">",j) j=html.find("<",i) if html[i+1:i+8] == "Faculty": result.append((html[i+1:j])) num+=1 return result def download_faculty_images(url): html = load_html(url) X = get_amount_of_faculties(url) Y = 1 pattern1 = "post-media" pattern2 = "img" pattern3 = "data-src" pattern4 = "data-srcset" pattern5 = "1024w" pattern6 = "300w" i = html.find(pattern1) if i >=0 : j=html.find(pattern2,i) i=html.find(pattern3,j) j=html.find(pattern4,i) i=html.find(pattern5,j) j=html.find(pattern6,i) pic = html[i:j] pos1_pic = pic.find("https://") pos2_pic = pic.find(" 300w") image_url = pic[pos1_pic:pos2_pic] pos3_pic = pic.find("/image/") pos4_pic = pic.find(".jpg") filename = pic[pos3_pic+7:pos4_pic] save_image(image_url,filename) while Y < X: i = html.find(pattern1,j) if i >=0 : j=html.find(pattern2,i) i=html.find(pattern3,j) j=html.find(pattern4,i) i=html.find(pattern5,j) j=html.find(pattern6,i) pic = html[i:j] pos1_pic = pic.find("https://") pos2_pic = pic.find(" 300w") image_url = pic[pos1_pic:pos2_pic] pos3_pic = pic.find("/image/") pos4_pic = pic.find(".jpg") filename = pic[pos3_pic+7:pos4_pic] save_image(image_url,filename) Y+=1 pass def print_faculty_numbers(url): X = get_amount_of_faculties(url) html = load_html(url) pattern1 = "post-entry" pattern2 = "<a href=" pattern3 = "data-src" pattern4 = "data-srcset" Tel_No = [] i = html.find(pattern1) if i >=0 : num=1 j=html.find(pattern2,i) i=html.find(">",j) url2 = html[j+9:i-1] print(url2[27:-5]) i1 = url2.find("academic") j1 = url2.find("/") html2 = str(urq.urlopen(url2).read().decode('utf-8')) p1 = "Tel:" i1=html2.find("Tel:") if i1>=0 : j1=html2.find("+66",i1) i1=html2.find("<",j1) tel=html2[j1:i1] tel=tel.split() for i in range(len(tel)) : if tel[i]=="+66" : Tel_No.append("0") elif tel[i][-1] =="," : Tel_No.append(tel[i][0:-1]) else : Tel_No.append(tel[i]) print(" ".join(Tel_No[0:3])) i1=j1=0 while num <X : Tel_No=[] num+=1 i=html.find(pattern1,j) j=html.find(pattern2,i) i=html.find(">",j) url2 = html[j+9:i-1] print(url2[27:-5]) html2 = str(urq.urlopen(url2).read().decode('utf-8')) p1 = "Tel:" i1=html2.find(p1) if i1>=0 : j1=html2.find("+66",i1) i1=html2.find("<",j1) tel=html2[j1:i1] tel=tel.split() for i in range(len(tel)) : if tel[i]=="+66" : Tel_No.append("0") elif tel[i][-1] =="," : Tel_No.append(tel[i][0:-1]) else : Tel_No.append(tel[i]) print(" ".join(Tel_No[0:3])) i1=j1=0 #------------------------------------------------- def save_image(img_url, filename): d = urq.urlopen(img_url) l = open(filename+".jpg","wb") l.write(d.read()) l.close() pass def get_amount_of_faculties(url): X = get_faculty_names(url) return len(X)

all: cluster #3 (5)

# 6331215221 (2020-10-18 23:14) %diff = 0.0 32% def get_faculty_names(url): total = load_html(url).split('<div class="post-entry">') faculty = [] for infm in total: f = infm.find('Faculty of ') i = infm.find('</a>') if infm[f:i] == '': pass else: faculty += [infm[f:i]] return faculty def download_faculty_images(url): image = [] k = load_html(url).split('\n') m =[] for line in k: if 'image/' in line and '300x188' in line and '300w' in line and 'faculty-" in line': s = line.find('http') f = line.find('jpg') if line[s:f] == '': pass else: image.append(line[s:f+3]) for l in range(len(image)): if l == 0: m.append(image[l]) else: if image[l] != image[l-1]: m.append(image[l]) for e in image: m = save_image(e,e.split("/")[-1]) def print_faculty_numbers(url): faculty_names = get_faculty_names(url) files = load_html(url) files = files[files.find('<div class="grid-item">'):files.find('<div class="box box-boldlink">')] for i in range(files.count('Faculty')): files = files[files.find('<div class="post-media">'):] page_url = files[files.find('<a href="')+9:].split()[0][:-2] files = files[files.find(page_url) + len(page_url) - 1:] page_2 = load_html(page_url) flag = page_2[page_2.find('Tel:'):] check_list = flag[flag.find('</strong>') + 9:flag.find("<br>")].strip().replace("+66", "0").split(",") number = check_list[0].split() print(faculty_names[i]) print(number[0], number[1], number[2]) #------------------------------------------------- def save_image(img_url, filename): d = urq.urlopen(img_url) d.close() i = open(filename,"wb") i.write(d.read()) i.close return filename# 6331223221 (2020-10-18 23:35) %diff = 6.86 32% def get_faculty_names(url): total = load_html(url).split('<div class="post-entry">') faculty = [] for infm in total: f = infm.find('Faculty of ') i = infm.find('</a>') if infm[f:i] == '': pass else: faculty += [infm[f:i]] return faculty def download_faculty_images(url): i = [] k = load_html(url).split('\n') m =[] for line in k: if 'image/' in line and '300x188' in line and '300w' in line and 'faculty-" in line': s = line.find('http') f = line.find('jpg') if line[s:f] == '': pass else: i.append(line[s:f+3]) for l in range(len(i)): if l == 0: m.append(i[l]) else: if i[l] != i[l-1]: m.append(i[l]) for e in i: m = save_image(e,e.split("/")[-1]) def print_faculty_numbers(url): faculty_names = get_faculty_names(url) files = load_html(url) files = files[files.find('<div class="grid-item">'):files.find('<div class="box box-boldlink">')] for i in range(files.count('Faculty')): files = files[files.find('<div class="post-media">'):] page_url = files[files.find('<a href="')+9:].split()[0][:-2] files = files[files.find(page_url) + len(page_url) - 1:] page_2 = load_html(page_url) flag = page_2[page_2.find('Tel:'):] check_list = flag[flag.find('</strong>') + 9:flag.find("<br>")].strip().replace("+66", "0").split(",") number = check_list[0].split() print(faculty_names[i]) print(number[0], number[1], number[2]) #------------------------------------------------- def save_image(img_url, filename): m = urq.urlopen(img_url) m.close() n = open(filename,"wb") n.write(m.read()) n.close return filename# 6331235821 (2020-10-18 23:35) %diff = 0.0 32% def get_faculty_names(url): total = load_html(url).split('<div class="post-entry">') faculty = [] for infm in total: f = infm.find('Faculty of ') i = infm.find('</a>') if infm[f:i] == '': pass else: faculty += [infm[f:i]] return faculty def download_faculty_images(url): image = [] k = load_html(url).split('\n') m =[] for line in k: if 'image/' in line and '300x188' in line and '300w' in line and 'faculty-" in line': s = line.find('http') f = line.find('jpg') if line[s:f] == '': pass else: image.append(line[s:f+3]) for l in range(len(image)): if l == 0: m.append(image[l]) else: if image[l] != image[l-1]: m.append(image[l]) for e in image: m = save_image(e,e.split("/")[-1]) def print_faculty_numbers(url): faculty_names = get_faculty_names(url) files = load_html(url) files = files[files.find('<div class="grid-item">'):files.find('<div class="box box-boldlink">')] for i in range(files.count('Faculty')): files = files[files.find('<div class="post-media">'):] page_url = files[files.find('<a href="')+9:].split()[0][:-2] files = files[files.find(page_url) + len(page_url) - 1:] page_2 = load_html(page_url) flag = page_2[page_2.find('Tel:'):] check_list = flag[flag.find('</strong>') + 9:flag.find("<br>")].strip().replace("+66", "0").split(",") number = check_list[0].split() print(faculty_names[i]) print(number[0], number[1], number[2]) #------------------------------------------------- def save_image(img_url, filename): d = urq.urlopen(img_url) d.close() i = open(filename,"wb") i.write(d.read()) i.close return filename# 6331211721 (2020-10-18 23:37) %diff = 0.0 32% def get_faculty_names(url): total = load_html(url).split('<div class="post-entry">') faculty = [] for infm in total: f = infm.find('Faculty of ') i = infm.find('</a>') if infm[f:i] == '': pass else: faculty += [infm[f:i]] return faculty def download_faculty_images(url): image = [] n = load_html(url).split('\n') m =[] for line in n: if 'image/' in line and '300x188' in line and '300w' in line and 'faculty-" in line': s = line.find('http') f = line.find('jpg') if line[s:f] == '': pass else: image.append(line[s:f+3]) for l in range(len(image)): if l == 0: m.append(image[l]) else: if image[l] != image[l-1]: m.append(image[l]) for e in image: m = save_image(e,e.split("/")[-1]) def print_faculty_numbers(url): faculty_names = get_faculty_names(url) files = load_html(url) files = files[files.find('<div class="grid-item">'):files.find('<div class="box box-boldlink">')] for i in range(files.count('Faculty')): files = files[files.find('<div class="post-media">'):] page_url = files[files.find('<a href="')+9:].split()[0][:-2] files = files[files.find(page_url) + len(page_url) - 1:] page_2 = load_html(page_url) flag = page_2[page_2.find('Tel:'):] check_list = flag[flag.find('</strong>') + 9:flag.find("<br>")].strip().replace("+66", "0").split(",") number = check_list[0].split() print(faculty_names[i]) print(number[0], number[1], number[2]) #------------------------------------------------- def save_image(img_url, filename): k = urq.urlopen(img_url) k.close() i = open(filename,"wb") i.write(k.read()) i.close return filename# 6331221021 (2020-10-18 23:42) %diff = 0.0 32% def get_faculty_names(url): total = load_html(url).split('<div class="post-entry">') faculty = [] for infm in total: f = infm.find('Faculty of ') i = infm.find('</a>') if infm[f:i] == '': pass else: faculty += [infm[f:i]] return faculty def download_faculty_images(url): image = [] k = load_html(url).split('\n') m =[] for line in k: if 'image/' in line and '300x188' in line and '300w' in line and 'faculty-" in line': s = line.find('http') f = line.find('jpg') if line[s:f] == '': pass else: image.append(line[s:f+3]) for l in range(len(image)): if l == 0: m.append(image[l]) else: if image[l] != image[l-1]: m.append(image[l]) for e in image: m = save_image(e,e.split("/")[-1]) def print_faculty_numbers(url): faculty_names = get_faculty_names(url) files = load_html(url) files = files[files.find('<div class="grid-item">'):files.find('<div class="box box-boldlink">')] for i in range(files.count('Faculty')): files = files[files.find('<div class="post-media">'):] page_url = files[files.find('<a href="')+9:].split()[0][:-2] files = files[files.find(page_url) + len(page_url) - 1:] page_2 = load_html(page_url) flag = page_2[page_2.find('Tel:'):] check_list = flag[flag.find('</strong>') + 9:flag.find("<br>")].strip().replace("+66", "0").split(",") number = check_list[0].split() print(faculty_names[i]) print(number[0], number[1], number[2]) #------------------------------------------------- def save_image(img_url, filename): d = urq.urlopen(img_url) d.close() i = open(filename,"wb") i.write(d.read()) i.close return filename

all: cluster #4 (6)

# 6231103521 (2020-10-18 23:54) %diff = 0.16 18% def get_faculty_names(url): html = load_html(url) name = [] a = html.find('Faculty of '); c = a for i in range(a,len(html)): if i == a : q = html[i:].index('<') + i name.append(html[i:q]) b = html[c+1:].find('Faculty of ') + c + 1 if i == b: q = html[i:].index('<') + i name.append(html[i:q]) c = b return name def download_faculty_images(url): html = load_html(url) i = html.find('srcset=') j = html[i:].find('/') + i k = html[j:].find(',') save_image(html[i:j], html[j:k]) pass def print_faculty_numbers(url): html = load_html(url) t = html.find('+66 ') end = html[t:].find('<') + t tel = '0 '+ html[t:end][4:] print("faculty-of-allied-health-sciences") print(tel) def save_image(img_url, filename): d = url.urlopen(img_url) l = open(filename,'wt') l.write(d.read()) l.close() pass #-------------------------------------------------# 6231117321 (2020-10-18 23:54) %diff = 3.22 18% def get_faculty_names(url): html = load_html(url) name = [] a = html.find('Faculty of '); k = a for i in range(a,len(html)): if i == a : q = html[i:].index('<') + i name.append(html[i:q]) b = html[k+1:].find('Faculty of ') + k + 1 if i == b: q = html[i:].index('<') + i name.append(html[i:q]) k = b return name def download_faculty_images(url): html = load_html(url) i = html.find('srcset=') j = html[i:].find('/') + i k = html[j:].find(',') save_image(html[i:j], html[j:k]) pass def print_faculty_numbers(url): html = load_html(url) t = html.find('+66 ') end = html[t:].find('<') + t tel = '0 '+ html[t:end][4:] print("faculty-of-allied-health-sciences") print(tel) def save_image(img_url, filename): d = url.urlopen(img_url) l = open(filename,'wt') l.write(d.read()) l.close() pass #-------------------------------------------------# 6231502221 (2020-10-18 23:54) %diff = 0.16 18% def get_faculty_names(url): html = load_html(url) name = [] a = html.find('Faculty of '); c = a for i in range(a,len(html)): if i == a : q = html[i:].index('<') + i name.append(html[i:q]) b = html[c+1:].find('Faculty of ') + c + 1 if i == b: q = html[i:].index('<') + i name.append(html[i:q]) c = b return name def download_faculty_images(url): html = load_html(url) i = html.find('srcset=') j = html[i:].find('/') + i k = html[j:].find(',') save_image(html[i:j], html[j:k]) pass def print_faculty_numbers(url): html = load_html(url) t = html.find('+66 ') end = html[t:].find('<') + t tel = '0 '+ html[t:end][4:] print("faculty-of-allied-health-sciences") print(tel) #------------------------------------------------- def save_image(img_url, filename): x = url.urlopen(img_url) y = open(filename,'wt') y.write(d.read()) y.close() pass# 6231514821 (2020-10-18 23:54) %diff = 0.49 18% def get_faculty_names(url): html = load_html(url) name = [] a = html.find('Faculty of '); c = a for i in range(a,len(html)): if i == a : q = html[i:].index('<') + i name.append(html[i:q]) b = html[c+1:].find('Faculty of ') + c + 1 if i == b: q = html[i:].index('<') + i name.append(html[i:q]) c = b return name def download_faculty_images(url): html = load_html(url) i = html.find('srcset=') j = html[i:].find('/') + i k = html[j:].find(',') save_image(html[i:j], html[j:k]) def print_faculty_numbers(url): html = load_html(url) t = html.find('+66 ') end = html[t:].find('<') + t tel = '0 '+ html[t:end][4:] print("faculty-of-allied-health-sciences") print(tel) #------------------------------------------------- def save_image(img_url, filename): d = url.urlopen(img_url) l = open(filename,'wt') l.write(d.read()) l.close() pass# 6231125321 (2020-10-18 23:55) %diff = 2.22 18% def get_faculty_names(url): html = load_html(url) name = [] x = html.find('Faculty of '); c = x for i in range(x,len(html)): if i == x : q = html[i:].index('<') + i name.append(html[i:q]) b = html[c+1:].find('Faculty of ') + c + 1 if i == b: q = html[i:].index('<') + i name.append(html[i:q]) c = b return name def download_faculty_images(url): html = load_html(url) i = html.find('srcset=') j = html[i:].find('/') + i k = html[j:].find(',') save_image(html[i:j], html[j:k]) pass def print_faculty_numbers(url): html = load_html(url) t = html.find('+66 ') end = html[t:].find('<') + t tel = '0 '+ html[t:end][4:] print("faculty-of-allied-health-sciences") print(tel) #------------------------------------------------- def save_image(img_url, filename): d = filename.filenameopen(img_url) l = open(filename,'wt') l.write(d.read()) l.close() pass# 6231114421 (2020-10-18 23:59) %diff = 0.49 18% def get_faculty_names(url): html = load_html(url) name = [] a = html.find('Faculty of '); c = a for i in range(a,len(html)): if i == a : q = html[i:].index('<') + i name.append(html[i:q]) b = html[c+1:].find('Faculty of ') + c + 1 if i == b: q = html[i:].index('<') + i name.append(html[i:q]) c = b return name def download_faculty_images(url): html = load_html(url) i = html.find('srcset=') j = html[i:].find('/') + i k = html[j:].find(',') save_image(html[i:j], html[j:k]) def print_faculty_numbers(url): html = load_html(url) t = html.find('+66 ') end = html[t:].find('<') + t tel = '0 '+ html[t:end][4:] print("faculty-of-allied-health-sciences") print(tel) #------------------------------------------------- def save_image(img_url, filename): d = urq.urlopen(img_url) l = open(filename,'wb') l.write(x.read()) l.close() pass

all: cluster #5 (6)

# 6330023921 (2020-10-18 16:25) %diff = 9.74 80% def get_faculty_names(url): YY=[] b=load_html("https://waiiinta.github.io/") T=True k=0 while T==True : a=b.find(">Faculty of",k+1) f=b.find("<",a+1) k=a if b[a+1:f] not in YY and ("," not in b[a+1:f] and (b[a+1:f] != "")) : YY.append(b[a+1:f]) if a==-1 : T=False return (YY) def download_faculty_images(url): XX=[] YY=[] b=load_html("https://waiiinta.github.io/") T=True k=0 g=get_faculty_names(url) while T==True : a=b.find("https://waiiinta.github.io/image",k+1) f=b.find("300x188.jpg",a+1) f=f-1 k=a if b[a:f+12] not in YY and ("," not in b[a:f] and (b[a:f] != "")) : YY.append(b[a:f+12]) if b[a+33:f+12] not in XX and ("," not in b[a+33:f] and (b[a+33:f] != "")) : XX.append(b[a+33:f+12]) if a==-1 : T=False for i in range (0,len(g)): save_image(YY[i],XX[i]) pass def print_faculty_numbers(url): YY=[] b=load_html("https://waiiinta.github.io/") T=True k=0 while T==True : a=b.find("\"https://waiiinta.github.io/faculty-of",k+1) f=b.find(">",a+1) f=f-1 k=a if b[a+1:f] not in YY and ("," not in b[a+1:f] and (b[a+1:f] != "")) : YY.append(b[a+1:f]) if a==-1 : T=False g=get_faculty_names(url) for i in range(0,len(g)): m=load_html(YY[i]) if "Tel:</strong></span>" in m: a=m.find("Tel:</strong></span>",1) a=a+21 f=m.find("<br>",a+1) k=a h="0"+m[a+7:f] print(cc(g[i])) print(h) elif "class=\"wpcf-field-wysiwyg wpcf-field-custom-content-contact-2\"><p><strong>Tel:</strong>" in m: a=m.find("class=\"wpcf-field-wysiwyg wpcf-field-custom-content-contact-2\"><p><strong>Tel:</strong>",1) a=a+87 f=m.find("<b",a+1) k=a print(cc(g[i])) h="0"+m[a+4:a+14] print(h) else: a=m.find("Tel:</strong>",1) a=a+13 f=m.find("<b",a+1) k=a print(cc(g[i])) h="0"+m[a+4:a+14] print(h) pass #------------------------------------------------- def save_image(img_url, filename): d=urq.urlopen(img_url) i=open(filename , "wb" ) i.write(d.read()) i.close() pass def cc(ku) : ii="" for u in ku: if u==" " : ii+="-" else : ii+=u ii=ii.lower() return(ii)# 6330016521 (2020-10-18 18:45) %diff = 5.91 59% def get_faculty_names(url): Y=[] c=load_html("https://waiiinta.github.io/") T=True k=0 while T==True : i=c.find(">Faculty of",k+1) j=c.find("<",i+1) k=i if c[i+1:j] not in Y and ("," not in c[i+1:j] and (c[i+1:j] != "")) : Y.append(c[i+1:j]) if i==-1 : T=False return Y def download_faculty_images(url): q=[] w=[] c=load_html("https://waiiinta.github.io/") T=True k=0 l=get_faculty_names(url) while T==True : a=c.find("https://waiiinta.github.io/image",k+1) e=c.find("300x188.jpg",a+1) e=e-1 k=a if c[a:e+12] not in w and ("," not in c[a:e] and (c[a:e] != "")) : w.append(c[a:e+12]) if c[a+33:e+12] not in q and ("," not in c[a+33:e] and (c[a+33:e] != "")) : q.append(c[a+33:e+12]) if a==-1 : T=False for i in range (0,len(l)): save_image(w[i],q[i]) pass def print_faculty_numbers(url): Y=[] c=load_html("https://waiiinta.github.io/") T=True k=0 while T==True : a=c.find("\"https://waiiinta.github.io/faculty-of",k+1) e=c.find(">",a+1) e=e-1 k=a if c[a+1:e] not in Y and ("," not in c[a+1:e] and (c[a+1:e] != "")) : Y.append(c[a+1:e]) if a==-1 : T=False l=get_faculty_names(url) for i in range(19): c=load_html(Y[i]) if "Tel:</strong></span>" in c: a=c.find("Tel:</strong></span>",1) a=a+21 f=c.find("<br>",a+1) k=a print(l[i]) print(c[a+1:f]) elif "class=\"wpcf-field-wysiwyg wpcf-field-custom-content-contact-2\"><p><strong>Tel:</strong>" in c: a=c.find("class=\"wpcf-field-wysiwyg wpcf-field-custom-content-contact-2\"><p><strong>Tel:</strong>",1) a=a+87 f=c.find("<b",a+1) k=a print(l[i]) print(c[a+1:a+14]) else: a=c.find("Tel:</strong>",1) a=a+13 f=c.find("<b",a+1) k=a print(l[i]) print(c[a+1:a+14]) pass #------------------------------------------------- def save_image(img_url, filename): e=urq.urlopen(img_url) q=open(filename , "wb" ) q.write(e.read()) q.close() pass# 6330039021 (2020-10-18 19:41) %diff = 5.91 59% def get_faculty_names(url): NAME=[] link=load_html("https://waiiinta.github.io/") T=True k=0 while T==True : x=link.find(">Faculty of",k+1) y=link.find("<",x+1) k=x if link[x+1:y] not in NAME and ("," not in link[x+1:y] and (link[x+1:y] != "")) : NAME.append(link[x+1:y]) if x==-1 : T=False return NAME def download_faculty_images(url): NAME1=[] NAME=[] link=load_html("https://waiiinta.github.io/") T=True k=0 e=get_faculty_names(url) while T==True : x=link.find("https://waiiinta.github.io/image",k+1) y=link.find("300x188.jpg",x+1) y=y-1 k=x if link[x:y+12] not in NAME and ("," not in link[x:y] and (link[x:y] != "")) : NAME.append(link[x:y+12]) if link[x+33:y+12] not in NAME1 and ("," not in link[x+33:y] and (link[x+33:y] != "")) : NAME1.append(link[x+33:y+12]) if x==-1 : T=False for i in range (0,len(e)): save_image(NAME[i],NAME1[i]) pass def print_faculty_numbers(url): NAME=[] link=load_html("https://waiiinta.github.io/") T=True k=0 while T==True : x=link.find("\"https://waiiinta.github.io/faculty-of",k+1) y=link.find(">",x+1) y=y-1 k=x if link[x+1:y] not in NAME and ("," not in link[x+1:y] and (link[x+1:y] != "")) : NAME.append(link[x+1:y]) if x==-1 : T=False e=get_faculty_names(url) for i in range(19): c=load_html(NAME[i]) if "Tel:</strong></span>" in c: x=c.find("Tel:</strong></span>",1) x=x+21 y=c.find("<br>",x+1) k=x print(e[i]) print(c[x+1:y]) elif "class=\"wpcf-field-wysiwyg wpcf-field-custom-content-contact-2\"><p><strong>Tel:</strong>" in c: x=c.find("class=\"wpcf-field-wysiwyg wpcf-field-custom-content-contact-2\"><p><strong>Tel:</strong>",1) x=x+87 y=c.find("<b",x+1) k=x print(e[i]) print(c[x+1:x+14]) else: x=c.find("Tel:</strong>",1) x=x+13 y=c.find("<b",x+1) k=x print(e[i]) print(c[x+1:x+14]) pass #------------------------------------------------- def save_image(img_url, filename): a=urq.urlopen(img_url) i=open(filename , "wb" ) i.write(a.read()) i.close() pass# 6331518421 (2020-10-18 23:21) %diff = 2.28 57% def get_faculty_names(url): R=[] c=load_html("https://waiiinta.github.io/") k=0 for e in c : a=c.find(">Faculty of",k+1) f=c.find("<",a+1) k=a if c[a+1:f] not in R and ("," not in c[a+1:f] and (c[a+1:f] != "")) : R.append(c[a+1:f]) return R def download_faculty_images(url): A=[] B=[] c=load_html("https://waiiinta.github.io/") k=0 g=get_faculty_names(url) for e in c : a=c.find("https://waiiinta.github.io/image",k+1) f=c.find("300x188.jpg",a+1) f=f-1 k=a if c[a:f+12] not in B and ("," not in c[a:f] and (c[a:f] != "")) : B.append(c[a:f+12]) if c[a+33:f+12] not in A and ("," not in c[a+33:f] and (c[a+33:f] != "")) : A.append(c[a+33:f+12]) for i in range (0,len(g)): save_image(B[i],A[i]) pass def print_faculty_numbers(url): B=[] c=load_html("https://waiiinta.github.io/") k=0 for e in c : a=c.find("\"https://waiiinta.github.io/faculty-of",k+1) f=c.find(">",a+1) f=f-1 k=a if c[a+1:f] not in B and ("," not in c[a+1:f] and (c[a+1:f] != "")) : B.append(c[a+1:f]) g=get_faculty_names(url) for i in range(19): m=load_html(B[i]) if "Tel:</strong></span>" in m: a=m.find("Tel:</strong></span>",1) a=a+21 f=m.find("<br>",a+1) k=a print(g[i]) print(m[a+1:f]) elif "class=\"wpcf-field-wysiwyg wpcf-field-custom-content-contact-2\"><p><strong>Tel:</strong>" in m: a=m.find("class=\"wpcf-field-wysiwyg wpcf-field-custom-content-contact-2\"><p><strong>Tel:</strong>",1) a=a+87 f=m.find("<b",a+1) k=a print(g[i]) print(m[a+1:a+14]) else: a=m.find("Tel:</strong>",1) a=a+13 f=m.find("<b",a+1) k=a print(g[i]) print(m[a+1:a+14]) pass #------------------------------------------------- def save_image(img_url, filename): d=urq.urlopen(img_url) i=open(filename , "wb" ) i.write(d.read()) i.close() pass# 6331508121 (2020-10-18 23:25) %diff = 0.25 57% def get_faculty_names(url): result=[] web=load_html("https://waiiinta.github.io/") k=0 for e in web : a=web.find(">Faculty of",k+1) f=web.find("<",a+1) k=a if web[a+1:f] not in result and ("," not in web[a+1:f] and (web[a+1:f] != "")) : result.append(web[a+1:f]) return result def download_faculty_images(url): x=[] y=[] web=load_html("https://waiiinta.github.io/") k=0 g=get_faculty_names(url) for e in web : a=web.find("https://waiiinta.github.io/image",k+1) f=web.find("300x188.jpg",a+1) f=f-1 k=a if web[a:f+12] not in y and ("," not in web[a:f] and (web[a:f] != "")) : y.append(web[a:f+12]) if web[a+33:f+12] not in x and ("," not in web[a+33:f] and (web[a+33:f] != "")) : x.append(web[a+33:f+12]) for i in range (0,len(g)): save_image(y[i],x[i]) pass def print_faculty_numbers(url): result=[] web=load_html("https://waiiinta.github.io/") k=0 for e in web : a=web.find("\"https://waiiinta.github.io/faculty-of",k+1) f=web.find(">",a+1) f=f-1 k=a if web[a+1:f] not in result and ("," not in web[a+1:f] and (web[a+1:f] != "")) : result.append(web[a+1:f]) g=get_faculty_names(url) for i in range(19): m=load_html(result[i]) if "Tel:</strong></span>" in m: a=m.find("Tel:</strong></span>",1) a=a+21 f=m.find("<br>",a+1) k=a print(g[i]) print(m[a+1:f]) elif "class=\"wpcf-field-wysiwyg wpcf-field-custom-content-contact-2\"><p><strong>Tel:</strong>" in m: a=m.find("class=\"wpcf-field-wysiwyg wpcf-field-custom-content-contact-2\"><p><strong>Tel:</strong>",1) a=a+87 f=m.find("<b",a+1) k=a print(g[i]) print(m[a+1:a+14]) else: a=m.find("Tel:</strong>",1) a=a+13 f=m.find("<b",a+1) k=a print(g[i]) print(m[a+1:a+14]) pass #------------------------------------------------- def save_image(img_url, filename): d=urq.urlopen(img_url) i=open(filename , "wb" ) i.write(d.read()) i.close() pass# 6331507521 (2020-10-18 23:35) %diff = 0.25 57% def get_faculty_names(url): HH=[] z=load_html("https://waiiinta.github.io/") k=0 for e in z : a=z.find(">Faculty of",k+1) f=z.find("<",a+1) k=a if z[a+1:f] not in HH and ("," not in z[a+1:f] and (z[a+1:f] != "")) : HH.append(z[a+1:f]) return HH def download_faculty_images(url): JJ=[] KK=[] z=load_html("https://waiiinta.github.io/") k=0 g=get_faculty_names(url) for e in z : a=z.find("https://waiiinta.github.io/image",k+1) f=z.find("300x188.jpg",a+1) f=f-1 k=a if z[a:f+12] not in KK and ("," not in z[a:f] and (z[a:f] != "")) : KK.append(z[a:f+12]) if z[a+33:f+12] not in JJ and ("," not in z[a+33:f] and (z[a+33:f] != "")) : JJ.append(z[a+33:f+12]) for i in range (0,len(g)): save_image(KK[i],JJ[i]) pass def print_faculty_numbers(url): JJ=[] z=load_html("https://waiiinta.github.io/") k=0 for e in z : a=z.find("\"https://waiiinta.github.io/faculty-of",k+1) f=z.find(">",a+1) f=f-1 k=a if z[a+1:f] not in JJ and ("," not in z[a+1:f] and (z[a+1:f] != "")) : JJ.append(z[a+1:f]) g=get_faculty_names(url) for i in range(19): m=load_html(JJ[i]) if "Tel:</strong></span>" in m: a=m.find("Tel:</strong></span>",1) a=a+21 f=m.find("<br>",a+1) k=a print(g[i]) print(m[a+1:f]) elif "class=\"wpcf-field-wysiwyg wpcf-field-custom-content-contact-2\"><p><strong>Tel:</strong>" in m: a=m.find("class=\"wpcf-field-wysiwyg wpcf-field-custom-content-contact-2\"><p><strong>Tel:</strong>",1) a=a+87 f=m.find("<b",a+1) k=a print(g[i]) print(m[a+1:a+14]) else: a=m.find("Tel:</strong>",1) a=a+13 f=m.find("<b",a+1) k=a print(g[i]) print(m[a+1:a+14]) pass #------------------------------------------------- def save_image(img_url, filename): d=urq.urlopen(img_url) i=open(filename , "wb" ) i.write(d.read()) i.close() pass

all: cluster #6 (3)

# 6331220321 (2020-10-17 13:39) %diff = 2.13 63% def get_faculty_names(url): names_list = [] pages = load_html(url) pages = pages[pages.find('<div class="grid-item">'):pages.find('<div class="box box-boldlink">')] for _ in range(pages.count('Faculty')): pages = pages[pages.find('<h3 class="text-title-1">'):] buff = pages[pages.find('Faculty '):] names_list += [pages[pages.find('Faculty '):pages.find('Faculty ') + buff.find('</a>')].strip()] pages = pages[pages.find('Faculty ') + buff.find('</a>'):] return names_list def download_faculty_images(url): pages = load_html(url) pages = pages[pages.find('<div class="grid-item">'):pages.find('<div class="box box-boldlink">')] for _ in range(pages.count('Faculty')): pages = pages[pages.find('<div class="post-media">'):] pages = pages[pages.find('1024w, ') + 7:] img_url = pages[:pages.find('300w, ') - 1].strip() file_name = img_url[img_url.find('/image/') + 7:] save_image(img_url, file_name) def print_faculty_numbers(url): names_list = get_faculty_names(url) pages = load_html(url) pages = pages[pages.find('<div class="grid-item">'):pages.find('<div class="box box-boldlink">')] for i in range(pages.count('Faculty')): pages = pages[pages.find('<div class="post-media">'):] page_url = pages[pages.find('<a href="')+9:].split()[0][:-2] pages = pages[pages.find(page_url) + len(page_url) - 1:] pages_2 = load_html(page_url) buff = pages_2[pages_2.find('Tel:'):] dist = buff[buff.find('</strong>') + 9:buff.find("<br>")].strip().replace("+66", "0").split(",") phone_number = dist[0].split() print(names_list[i]) print(phone_number[0], phone_number[1], phone_number[2]) #------------------------------------------------- def save_image(img_url, filename): urllib.request.urlretrieve(img_url, filename)# 6331134021 (2020-10-18 21:44) %diff = 2.13 75% def get_faculty_names(url): faculty_names = [] files = load_html(url) files = files[files.find('<div class="grid-item">'):files.find('<div class="box box-boldlink">')] #print(files.count('Faculty')) for _ in range(files.count('Faculty')): files = files[files.find('<h3 class="text-title-1">'):] flag = files[files.find('Faculty '):] faculty_names += [files[files.find('Faculty '):files.find('Faculty ') + flag.find('</a>')].strip()] files = files[files.find('Faculty ') + flag.find('</a>'):] #print(len(faculty_names)) #print(faculty_names) return faculty_names def download_faculty_images(url): files = load_html(url) files = files[files.find('<div class="grid-item">'):files.find('<div class="box box-boldlink">')] for _ in range(files.count('Faculty')): files = files[files.find('<div class="post-media">'):] files = files[files.find('1024w, ') + 7:] img_url = files[:files.find('300w, ') - 1].strip() file_name = img_url[img_url.find('/image/') + 7:] save_image(img_url, file_name) def print_faculty_numbers(url): faculty_names = get_faculty_names(url) files = load_html(url) files = files[files.find('<div class="grid-item">'):files.find('<div class="box box-boldlink">')] for i in range(files.count('Faculty')): files = files[files.find('<div class="post-media">'):] page_url = files[files.find('<a href="')+9:].split()[0][:-2] files = files[files.find(page_url) + len(page_url) - 1:] page_2 = load_html(page_url) flag = page_2[page_2.find('Tel:'):] check_list = flag[flag.find('</strong>') + 9:flag.find("<br>")].strip().replace("+66", "0").split(",") number = check_list[0].split() print(faculty_names[i].lower().replace(" ", "-")) print(number[0], number[1], number[2]) #------------------------------------------------- def save_image(img_url, filename): urllib.request.urlretrieve(img_url, filename)# 6330048621 (2020-10-18 21:45) %diff = 12.23 75% def get_faculty_names(url): names = [] xx = load_html(url) f = xx.find xx = xx[f('<div class="grid-item">'):f('<div class="box box-boldlink">')] for i in range(xx.count('Faculty')): xx = xx[xx.find('<h3 class="text-title-1">'):] zz = xx[xx.find('Faculty '):] names.append(xx[xx.find('Faculty '):xx.find('Faculty ') + zz.find('</a>')].strip()) xx = xx[xx.find('Faculty ') + zz.find('</a>'):] return names def download_faculty_images(url): xx = load_html(url) f = xx.find xx = xx[f('<div class="grid-item">'):f('<div class="box box-boldlink">')] for i in range(xx.count('Faculty')): xx = xx[xx.find('<div class="post-media">'):] xx = xx[xx.find('1024w, ') + 7:] img_url = xx[:xx.find('300w, ') - 1].strip() file_name = img_url[img_url.find('/image/') + 7:] save_image(img_url, file_name) def print_faculty_numbers(url): names = get_faculty_names(url) xx = load_html(url) f = xx.find xx = xx[f('<div class="grid-item">'):f('<div class="box box-boldlink">')] for i in range(xx.count('Faculty')): xx = xx[xx.find('<div class="post-media">'):] pages = xx[xx.find('<a href="')+9:].split()[0][:-2] xx = xx[xx.find(pages) + len(pages) - 1:] yy = load_html(pages) zz = yy[yy.find('Tel:'):] dist = zz[zz.find('</strong>') + 9:zz.find("<br>")].strip().replace("+66", "0").split(",") phone_number = dist[0].split() x = [] for k in range(len(names)) : a = names[k].lower().split() x.append(a) print("-".join(x[i])) print(phone_number[0], phone_number[1], phone_number[2]) #------------------------------------------------- def save_image(img_url, filename): urllib.request.urlretrieve(img_url, filename)

all: cluster #7 (2)

# 6330169921 (2020-10-16 23:51) %diff = 3.71 82% def get_faculty_names(url): a = [] allstr = load_html(url) s1 = 0 for i in range(len(allstr)): s = allstr.find("post-entry",s1) s1 = allstr.find("</div>",s) if "Faculty of" in allstr[s:s1]: s3 = allstr.find("Faculty of",s) s4 = allstr.find("</a>",s3) if s3==-1: break x = allstr[s3:s4] a.append(x) return a def download_faculty_images(url): allstr = load_html(url) s1 = 0 for i in range(len(allstr)): s = allstr.find("post-media",s1) s1 = allstr.find("</div>",s) if "faculty-of" in allstr[s:s1]: s3 = allstr.find("https://waiiinta.github.io",s) s4 = allstr.find(".jpg",s3) while "300x188.jpg" not in allstr[s3:s4+4]: s3 = allstr.find("https://waiiinta.github.io",s4) s4 = allstr.find(".jpg",s3) if "chula-faculty" in allstr[s3:s4+4]: x = allstr[s3:s4+4] t1 = x.find("image/") x1 = x[t1+6:] save_image(x,x1) def print_faculty_numbers(url): a = [] allstr = load_html(url) s1 = 0 for i in range(len(allstr)): s = allstr.find("text-title-1",s1) s1 = allstr.find("</a>",s) if "faculty-of" in allstr[s:s1]: s3 = allstr.find("faculty-of",s) s4 = allstr.find("-chulalongkorn-university.html",s3) x = allstr[s3:s4] if s3==-1: break a.append(x) p = get_faculty_link(url) b = [] for i in p: q = load_html(i) s1 = 0 for i in range(len(q)): s = q.find("wpcf-field-custom-content-contact",s1) s1 = q.find("</div>",s) if "+66" in q[s:s1]: s3 = q.find("+66",s) m = q[s3+3:s3+13] if "(0)" in q[s3+3:s3+13]: s3 = q.find("(0)",s) m = q[s3+3:s3+13] if"</li>" in q[s3+3:s3+25]: break b.append("0"+m) if s==-1: break for i in range(len(a)): print(a[i]) print(b[i]) #------------------------------------------------- def save_image(img_url, filename): p = urq.urlopen(img_url) file = open(filename,"wb") file.write(p.read()) file.close() def get_faculty_link(url): a = [] allstr = load_html(url) s1 = 0 for i in range(len(allstr)): s = allstr.find("post-entry",s1) s1 = allstr.find("</div>",s) if "Faculty of" in allstr[s:s1]: s3 = allstr.find("https://waiiinta.github.io",s) s4 = allstr.find(".html",s3) if s==-1: break x = allstr[s3:s4+5] a.append(x) return a# 6330113721 (2020-10-18 18:02) %diff = 3.71 81% def get_faculty_names(url): faculty_name = [] html = load_html(url) f1 = 0 for ii in range(len(html)): f0 = html.find("text-title-1",f1) f1 = html.find("</div>",f0) if "Faculty of" in html[f0:f1]: f3 = html.find("Faculty of",f0) f4 = html.find("</a>",f3) if f3 == -1: break name = html[f3:f4] faculty_name.append(name) return faculty_name def download_faculty_images(url): html = load_html(url) f1 = 0 for iii in range(len(html)): f0 = html.find("post-media",f1) f1 = html.find("</div>",f0) if "faculty-of" in html[f0:f1]: f3 = html.find("https://waiiinta.github.io",f0) f4 = html.find(".jpg",f3) while "300x188.jpg" not in html[f3:f4+4]: f3 = html.find("https://waiiinta.github.io",f4) f4 = html.find(".jpg",f3) if "chula-faculty" in html[f3:f4+4]: image1 = html[f3:f4+4] find_image = image1.find("image/") image2 = image1[find_image+6:] save_image(image1,image2) def print_faculty_numbers(url): faculty_name = [] html = load_html(url) f1 = 0 for iiii in range(len(html)): f0 = html.find("text-title-1",f1) f1 = html.find("</a>",f0) if "faculty-of" in html[f0:f1]: f3 = html.find("faculty-of",f0) f4 = html.find("-chulalongkorn-university.html",f3) name = html[f3:f4] if f3 == -1: break faculty_name.append(name) faculty_link = get_faculty_link(url) faculty_number = [] for o in faculty_link: html_number = load_html(o) f1 = 0 for iiiii in range(len(html_number)): f0 = html_number.find("wpcf-field-custom-content-contact",f1) f1 = html_number.find("</div>",f0) if "+66" in html_number[f0:f1]: f3 = html_number.find("+66",f0) number = html_number[f3+3:f3+13] if "(0)" in html_number[f3+3:f3+13]: f3 = html_number.find("(0)",f0) number = html_number[f3+3:f3+13] if"</li>" in html_number[f3+3:f3+25]: break faculty_number.append("0"+number) if f0 == -1: break for iiiiii in range(len(faculty_number)): print(faculty_name[iiiiii]) print(faculty_number[iiiiii]) #------------------------------------------------- def save_image(img_url, filename): fout = urq.urlopen(img_url) file = open(filename,"wb") file.write(fout.read()) file.close() def get_faculty_link(url): faculty_link = [] html = load_html(url) f1 = 0 for i in range(len(html)): f0 = html.find("post-entry",f1) f1 = html.find("</div>",f0) if "Faculty of" in html[f0:f1]: f3 = html.find("https://waiiinta.github.io",f0) f4 = html.find(".html",f3) if f0 == -1: break link = html[f3:f4+5] faculty_link.append(link) return faculty_link

all: cluster #8 (4)

# 6330133221 (2020-10-18 19:28) %diff = 13.66 100% def get_faculty_names(url): lh = load_html(url) z = [] s = lh.find\ ('<div class="post-entry">') while s != -1: e = lh.find('</div>', s+1) i = lh[s:e].find("Faculty of ") if i != -1: j = lh[s:e].find("<", i+1) z.append(lh[s:e][i:j]) s = lh.find\ ('<div class="post-entry">', e+1) return z def download_faculty_images(url): lh = load_html(url) s = lh.find\ ('<div class="post-media">') while s != -1: e = lh.find('</div>', s+1) cs = lh.find\ ('<div class="post-entry">', e+1) ce = lh.find\ ('</div>', cs+1) ie = lh[s:e].find('300x188.jpg') + 11 ist = lh[s:e][::-1] istf = ist.find\ ('ptth', len(lh[s:e]) - ie -1) + 4 istf = len(lh[s:e]) - istf if "Faculty of" in lh[cs:ce]: ina = lh[s:e][istf:ie].split('/') save_image(lh[s:e][istf:ie], ina[-1]) s = lh.find\ ('<div class="post-media">', e+1) def print_faculty_numbers(url): lh = load_html(url) s = lh.find\ ('<div class="post-entry">') while s != -1: e = lh.find('</div>', s+1) i = lh[s:e].find("Faculty of ") if i != -1: j = lh[s:e].find("<", i+1) fname = lh[s:e][i:j] name = fname.lower().strip() phone = '' for x in name: if "a" <= x <= "z": phone += x else: phone += '-' print(phone) l = lh[s:e].find\ ('<a href="') + 9 m = lh[s:e].find\ ('"', l+1) page = load_html(lh[s:e][l:m]) n = page.find\ ('<div class="col-lg-6 pr-lg-30px">') o = page.find\ ('+66', n+1) p = page.find\ ('<', o+1) phone = "" for i in page[o:p]: if ("0" <= i <= "9")\ or i == "("\ or i == ")": phone += i x = phone.find("(") if x != -1: y = phone.find(")") + 1 phone = phone[:x] + phone[y:] print("0 " + phone[2:6:1] + " " + phone[6:10:1] + "\n") s = lh.find\ ('<div class="post-entry">', e+1) #------------------------------------------------- def save_image(img_url, filename): d = urq.urlopen(img_url) I = open(filename, "wb") I.write(d.read()) I.close()# 6330017121 (2020-10-18 19:53) %diff = 3.88 100% def get_faculty_names(url): u = load_html(url) o = [] s = u.find('<div class="post-entry">') while s != -1: e = u.find('</div>', s + 1) i = u[s:e].find('Faculty of ') if i != -1: j = u[s:e].find('<', i + 1) o.append(u[s:e][i:j]) s = u.find('<div class="post-entry">', e + 1) return o def download_faculty_images(url): u = load_html(url) s = u.find('<div class="post-media">') while s != -1: e = u.find('</div>', s + 1) Ie = u[s:e].find('300x188.jpg') + 11 Ist = u[s:e][::-1].find('ptth', len(u[s:e]) - Ie - 1) + 4 Ist = len(u[s:e]) - Ist chs = u.find('<div class="post-entry">', e + 1) che = u.find('</div>', chs + 1) if "Faculty of" in u[chs:che]: In = u[s:e][Ist:Ie].split('/') save_image(u[s:e][Ist:Ie], In[-1]) s = u.find('<div class="post-media">', e + 1) def print_faculty_numbers(url): u = load_html(url) s = u.find('<div class="post-entry">') while s != -1: e = u.find('</div>', s + 1) i = u[s:e].find('Faculty of ') if i != -1: j = u[s:e].find('<', i + 1) fn = u[s:e][i:j].lower() x = '' for c in fn: if "a" <= c <= "z": x += c else: x += '-' print(x) a = u[s:e].find('<a href="') + 9 b = u[s:e].find('"', a + 1) page = load_html(u[s:e][a:b]) c = page.find('<div class="col-lg-6 pr-lg-30px">') d = page.find('+66', c + 1) f = page.find('<', d + 1) g = "" for i in page[d:f]: if ("0" <= i <= "9") or i == "(" or i == ")": g += i y = g.find("(") if y != -1: z = g.find(")") + 1 g = g[:y] + g[z:] print("0 " + g[2:6] + " " + g[6:10] + "\n") s = u.find('<div class="post-entry">', e + 1) #------------------------------------------------- def save_image(img_url, filename): d = urq.urlopen(img_url) I = open(filename, "wb") I.write(d.read()) I.close()# 6330095021 (2020-10-18 21:36) %diff = 5.05 100% def get_faculty_names(url): x = load_html(url) a = [] start = x.find('<div class="post-entry">') while start != -1: end = x.find('</div>', start+10) b = x[start:end].find("Faculty of ") if b != -1: c = x[start:end].find("<", b+10) a.append(x[start:end][b:c]) start = x.find('<div class="post-entry">', end+10) return a def download_faculty_images(url): x = load_html(url) start = x.find('<div class="post-media">') while start != -1: end = x.find('</div>', start+1) iend = x[start:end].find('300x188.jpg') + 11 istart = x[start:end][::-1].find('ptth', len(x[start:end]) - iend - 1) + 4 istart = len(x[start:end]) - istart cstart = x.find('<div class="post-entry">', end+1) cend = x.find('</div>', cstart+1) if "Faculty of" in x[cstart:cend]: iname = x[start:end][istart:iend].split('/') save_image(x[start:end][istart:iend], iname[-1]) start = x.find('<div class="post-media">', end+1) def print_faculty_numbers(url): r = load_html(url) start = r.find('<div class="post-entry">') while start != -1: end = r.find('</div>', start+10) i = r[start:end].find("Faculty of ") if i != -1: j = r[start:end].find("<", i+10) f = r[start:end][i:j].lower() out = '' for c in f: if "a" <= c <= "z": out += c else : out += '-' print(out) a = r[start:end].find('<a href="') + 9 b = r[start:end].find('"', a+10) l = load_html(r[start:end][a:b]) c = l.find('<div class="col-lg-6 pr-lg-30px">') d = l.find('+66', c+10) e = l.find('<', d+10) out = "" for i in l[d:e]: if ("0" <= i <= "9") or i == "(" or i == ")": out += i x = out.find("(") if x != -1: y = out.find(")") + 1 out = out[:x] + out[y:] print("0 " + out[2:6] + " " + out[6:10] + "\n") start = r.find('<div class="post-entry">', end+10) #------------------------------------------------- def save_image(img_url, filename): d = urq.urlopen(img_url) I = open(filename, "wb") I.write(d.read()) I.close()# 6330119521 (2020-10-18 23:43) %diff = 3.88 86% def get_faculty_names(url): browser = load_html(url) u = [] initial = browser.find('<div class="post-entry">') while initial != -1: final = browser.find('</div', initial + 1) f = browser[initial:final].find("Faculty of") if f != -1: g = browser[initial:final].find("<", f + 1) u.append(browser[initial:final][f:g]) initial = browser.find('<div class="post-entry">', final + 1) return u def download_faculty_images(url): browser = load_html(url) initial = browser.find('<div class="post-media">') while initial != -1: final = browser.find('</div>', initial + 1) img_final = browser[initial:final].find('300x188.jpg') + 11 img_initial = browser[initial:final][::-1].find('ptth', len(browser[initial:final]) - img_final - 1) + 4 img_initial = len(browser[initial:final]) - img_initial test_initial = browser.find('<div class="post-entry">', final + 1) test_final = browser.find('</div>', test_initial + 1) if "Faculty of" in browser[test_initial:test_final]: img_name = browser[initial:final][img_initial:img_final].split('/') save_image(browser[initial:final][img_initial:img_final], img_name[-1]) initial = browser.find('<div class="post-media">', final + 1) def print_faculty_numbers(url): browser = load_html(url) initial = browser.find('<div class="post-entry">') while initial != -1: final = browser.find('</div', initial + 1) f = browser[initial:final].find("Faculty of") if f != -1: g = browser[initial:final].find("<", f + 1) fac_name = browser[initial:final][f:g].lower().strip() sol = ' ' for ch in fac_name: if "a" <= ch <= "z": sol += ch else: sol += '-' print(sol) x = browser[initial:final].find('<a href="') + 9 y = browser[initial:final].find('"', x + 1) web_page = load_html(browser[initial:final][x:y]) z = web_page.find('<div class="col-lg-6 pr-lg-30px">') m = web_page.find('+66', z + 1) n = web_page.find('<', m + 1) sol = " " for i in web_page[m:n]: if ("0" <= i <= "9") or i == "(" or i == ")": sol += i s = sol.find("(") if s != -1: p = sol.find(")") + 1 sol = sol[:s] + sol[p:] print("0 " + sol[2:6] + " " + sol[6:10] + "\n") initial = browser.find('<div class="post-entry">', final + 1) #------------------------------------------------- def save_image(img_url, filename): d = urq.urlopen(img_url) I = open(filename, "wb") I.write(d.read()) I.close()

all: cluster #9 (2)

# 6230450021 (2020-10-18 12:46) %diff = 4.91 77% def get_faculty_names(url): web = load_html(url) fac = [] a = web.find('Faculty of') b = web.find('</a>',a) while a>= 0: ans = web[a:b] fac.append(ans) a = web.find('Faculty of',b) b = web.find('</a>',a) if len(web[a:b]) > 100: break return fac def download_faculty_images(url): web = load_html(url) img = [] head = 'https://waiiinta.github.io/image/' start = '1024w,' end = '300w,' x = web.find(start) y = web.find(head,x) z = web.find(end,y) n = web[y:z] checkpoint = 'data-loaded="true"' for i in range(len(web)): img.append(web[y:z-1]) d = web.find(checkpoint,x) x = web.find(start,d) y = web.find(head,x) z = web.find(end,y) if '' in img: break if 'School' in web[y:z]: break for i in range(len(img)): save_image(img[i],img[i][33:]) def print_faculty_numbers(url): web = load_html(url) a = web.find('<div class="post-media">') b = web.find('">', a) c = web.find('faculty',a) d = web.find('chulalongkorn',c) a = web.find('https:',b) b = web.find('">',a) link = [] name = [] while a>= 0: ans = web[a:b] fac = web[c:d-1] link.append(ans) name.append(fac) a = web.find('<div class="post-media">',b) b = web.find('">', a) c = web.find('faculty',a) d = web.find('chulalongkorn',c) a = web.find('https:',b) b = web.find('">',a) if len(link) == 19 : break tel = [] for d in range (len(link)) : web_fac = load_html(link[d]) a = web_fac.find('<div id="wpcf-field-custom-content-contact') c = web_fac.find('Tel:',a) b = web_fac.find('<br>',c) str_num = web_fac[c+4:b] a = str_num.find('22') number = '0 ' + str_num[a:a+9] tel.append(number) for a in range (len(name)): print (name[a]) print (tel[a]) #------------------------------------------------- def save_image(img_url, file_name): a = urq.urlopen(img_url).read() fout = open(file_name,"wb") fout.write(a) fout.close()# 6331809021 (2020-10-18 15:15) %diff = 4.91 62% def get_faculty_names(url): web = load_html(url) fac = [] i = web.find('Faculty of') j = web.find('</a>',i) while i>= 0: ans = web[i:j] fac.append(ans) i = web.find('Faculty of',j) j = web.find('</a>',i) if len(web[i:j]) > 100: break return fac def download_faculty_images(url): web = load_html(url) pic = [] topic = 'https://waiiinta.github.io/image/' end_ = '300w,' begin = '1024w,' x = web.find(begin) y = web.find(topic,x) z = web.find(end_,y) checkpoint = 'data-loaded="true"' for i in range(len(web)): pic.append(web[y:z-1]) d = web.find(checkpoint,x) x = web.find(begin,d) y = web.find(topic,x) z = web.find(end_,y) if '' in pic: break if 'School' in web[y:z]: break for i in range(len(pic)): save_image(pic[i],pic[i][33:]+'.jpg') def print_faculty_numbers(url): web = load_html(url) i = web.find('<div class="post-media">') j = web.find('">', i) h = web.find('faculty',i) k = web.find('chulalongkorn',h) i = web.find('https:',j) j = web.find('">',i) link_fac = [] name_fac = [] while i>= 0: ans = web[i:j] fac = web[h:k-1] link_fac.append(ans) name_fac.append(fac) i = web.find('<div class="post-media">',j) j = web.find('">', i) h = web.find('faculty',i) k = web.find('chulalongkorn',h) i = web.find('https:',j) j = web.find('">',i) if len(link_fac) == 19 : break tel = [] for k in range (len(link_fac)) : web_fac = load_html(link_fac[k]) i = web_fac.find('<div id="wpcf-field-custom-content-contact') h = web_fac.find('Tel:',i) j = web_fac.find('<br>',h) str_num = web_fac[h+4:j] a = str_num.find('22') number = '0 ' + str_num[a:a+9] tel.append(number) for i in range (len(name_fac)): print (name_fac[i]) print (tel[i]) #------------------------------------------------- def save_image(img_url, filename): a = urq.urlopen(img_url).read() fout = open(filename,"wb") fout.write(a) fout.close()

all: cluster #10 (2)

# 6331125421 (2020-10-18 23:54) %diff = 7.91 96% def get_faculty_names(url): w = load_html(url) names = [] b = 0 for i in range(w.count("<h3")): a = w.find("<h3",b) x = w.find("Faculty of",a) y = w.find("</a",x) b = w.find("</h3>",a) if "Faculty of" in w[a:b]: names.append(w[x:y]) return names def download_faculty_images(url): w = load_html(url) k = 0 for e in range(w.count("data-src=")): t = False j = w.find("data-src=",k) k = w.find("src=",j+7) d = w[j:k] g = d.split() a = w.find("<h3",j) x = w.find("Faculty of",a) y = w.find("</a",x) b = w.find("</h3>",a) for i in range(len(g)): s = 0 if "300x188" in g[i]and "Faculty of" in w[a:b]: s = g[i] im = s.find("image/") im_name = s[im+6:] save_image(s, im_name) break def print_faculty_numbers(url): w = load_html(url) v = 0 har = 0 b = 0 for q in range(w.count("post-media")) : har = w.find("post-media",har+1) num = w.find("href=",har) ber = w.find(">",num) lk = w[num+6:ber-1] if "faculty-of" in lk : ww = load_html(lk) m = ww.find("col-lg-6") z = ww.find("+66",m) p = ww.find("<",z) tel = ww[z:p] tel = "0 "+ tel[tel.find("2"):tel.find("2")+9] print(lk[lk.find(".io")+4:lk.find("chula")-1]) print(tel) print() #------------------------------------------------- def save_image(img_url, filename): im_1 = urq.urlopen(img_url) save_im1 = open(filename,"wb") save_im1.write(im_1.read()) save_im1.close()# 6145072428 (2020-10-18 23:59) %diff = 7.91 60% def get_faculty_names(url): strhtml = load_html(url) FCTnames = [] #Faculties list b = 0 for i in range(strhtml.count("h3")): a = strhtml.find("<h3",b) x = strhtml.find("Faculty of",a) y = strhtml.find("</a",x) b = strhtml.find("</h3>",a) if "Faculty of" in strhtml[a:b]: FCTnames.append(strhtml[x:y]) return FCTnames def download_faculty_images(url): strhtml = load_html(url) k = 0 for e in range(strhtml.count("data-src=")): t = False j = strhtml.find("data-src=",k) k = strhtml.find("src=",j+7) d = strhtml[j:k] g = d.split() a = strhtml.find("<h3",j) x = strhtml.find("Faculty of",a) y = strhtml.find("</a",x) b = strhtml.find("</h3>",a) for i in range(len(g)): s = 0 if "300x188" in g[i] and "Faculty of" in strhtml[a:b]: s = g[i] img = s.find("image/") imgname = s[img+6:-1] save_image(s, imgname) break def print_faculty_numbers(url): strhtml = load_html(url) v = 0 b = 0 for i in range(strhtml.count("post-media")): v = strhtml.find("post-media", v+1) x = strhtml.find("href",v) y = strhtml.find(">", x) link = strhtml[x+6:y-1] if "faculty-of" in link: ww = load_html(link) a = ww.find("col-lg-6") b = ww.find("+66",a) c = ww.find("<",b) tel = ww[b:c] tel = "0" +" "+ tel[tel.find("2"):tel.find("2")+9] print(link[link.find(".io")+4:link.find("chula")-1]) print(tel) #------------------------------------------------- def save_image(img_url, filename): #return nothing imgurl = urq.urlopen(img_url) l = open(filename,"wb") l.write(imgurl.read()) l.close()

all: cluster #11 (2)

# 6331419021 (2020-10-15 00:07) %diff = 10.23 80% def get_faculty_names(url): faculty_list = [] html = load_html(url) while True : index_div = html.find('<h3 class="text-title-1">') + len('h3 class="text-title-1">') index_div1 = html.find('</a>', index_div) index_div2 = html.find('">',index_div) + len('">') f = html[index_div2:index_div1] html = html[index_div1:] if index_div == -1 or index_div1 == -1 or index_div2 == -1 or len(html) == 0 : break if f.find('Faculty') == 0 : faculty_list.append(f) return faculty_list def download_faculty_images(url): url_list = [] index_url2 = 0 html = load_html(url) while True : index_url = html.find('<div class="post-media">',index_url2) index_url1 = html.find('1024w,',index_url) + len('1024w,') index_url2 = html.find('300w',index_url1) index_href = html.find("<a href",index_url) index_html = html.find("html",index_href) a = html[index_url1:index_url2] b = html[index_href:index_html] if index_url == -1 or index_url1 == -1 or len(html) == 0 : break a = a.strip() if 'faculty' in b : index_img = a.find('image/') + len('image/') name_img = a[index_img:] save_image(a,name_img) def print_faculty_numbers(url): html = load_html(url) faculty_list = [] tel_list = [] while True : index_name = html.find('<h3 class="text-title-1">') + len('h3 class="text-title-1">') index_name1 = html.find('-chulalongkorn-university.html', index_name) index_name2 = html.find('.io/',index_name) + 4 f = html[index_name2:index_name1] html = html[index_name:] if index_name == -1 or index_name1 == -1 or index_name2 == -1 or len(html) == 0 : break if f.find('faculty') == 0 : faculty_list.append(f) for i in range(len(faculty_list)): url = 'https://waiiinta.github.io/'+faculty_list[i]+'-chulalongkorn-university.html' html = load_html(url) index_position = html.find('<div class="col-lg-6">') index_tel = html.find('+66',index_position) + len('+66') index_tel1 = html.find('<',index_tel) tel = html[index_tel:index_tel1] m = tel.find("2") tel = " "+tel[m:10+m-1] tel_list.append(tel) for i in range(len(faculty_list)): print(faculty_list[i]) print("0"+tel_list[i]) print("") #------------------------------------------------- def save_image(img_url, filename): image = urq.urlopen(img_url) x = open(filename,'wb') x.write(image.read()) x.close# 6331010921 (2020-10-18 20:54) %diff = 10.23 39% def get_faculty_names(url): faculty_list = [] html = load_html(url) while True : index_pos = html.find('<h3 class="text-title-1">') + len('h3 class="text-title-1">') index = html.find('">F', index_pos) + len('">') index_end = html.find('</a>',index) url = html[index:index_end] if index_pos == -1 or index == -1 or index_end == -1 or len(html) == 0 : break if url.find('Faculty') == 0 : faculty_list.append(url) return faculty_list def download_faculty_images(url): url_list = [] z = 0 html = load_html(url) while True : x = html.find('<div class="grid-item">',z) y = html.find('1024w,',x) + len('1024w,') z = html.find('300w',y) index_href = html.find("<a href",x) index_html = html.find("html",index_href) a = html[y:z] b = html[index_href:index_html] if x == -1 or y == -1 or len(html) == 0 : break a = a.strip() if 'faculty' in b : index_img = a.find('image/') + len('image/') name_img = a[index_img:] save_image(a,name_img) def print_faculty_numbers(url): html = load_html(url) faculty_list = [] tel_list = [] while True : index_name = html.find('<div class="post-media">') + len('div class="post-media">') index_name1 = html.find('-chulalongkorn-university.html', index_name) index_name2 = html.find('.io/',index_name) + 4 a = html[index_name2:index_name1] html = html[index_name:] if index_name == -1 or index_name1 == -1 or index_name2 == -1 or len(html) == 0 : break if a.find('faculty') == 0 : faculty_list.append(a) for i in range(len(faculty_list)): url = 'https://waiiinta.github.io/'+faculty_list[i]+'-chulalongkorn-university.html' html = load_html(url) index_ref = html.find('<div class="col-lg-6 col-md-12 col-sm-6 col-12">') index_1 = html.find('+66',index_ref) + len('+66') index_2 = html.find('<',index_1) tel = html[index_1:index_2] u = tel.find("2") tel = " "+tel[u:10+u-1] tel_list.append(tel) for i in range(len(faculty_list)): print(faculty_list[i]) print("0"+tel_list[i]) print("") #------------------------------------------------- def save_image(img_url, filename): image = urq.urlopen(img_url) x = open(filename,'wb') x.write(image.read()) x.close

all: cluster #12 (2)

# 6331132821 (2020-10-18 23:50) %diff = 12.03 64% def get_faculty_names(url): html = load_html(url) fai=0;pooh=0;coco=0 faculty_name = [] for s in html: fai = html.find('<div class="post-entry">',coco) if fai == -1: break pooh = html.find('Faculty of',fai) coco = html.find('</a>',pooh) if '<div class="fullwidth-content">' not in html[pooh:coco]: faculty_name.append(html[pooh:coco]) return faculty_name def download_faculty_images(url): html = load_html(url) x = len(get_faculty_names(url)) media = 0 tw = 0 sw = 0 i = 0 while True: media = html.find('<div class="post-media">',sw) if media == -1 or i == x: break tw = html.find('1024w,',media) + 6 sw = html.find(' 300w',tw) pic = html[tw:sw] name = pic.split("/") save_image(pic,name[-1]) i += 1 def print_faculty_numbers(url): html = load_html(url) http = 0 pause = 0 x = len(get_faculty_names(url)) i = 0 while True: if i == x: break media = html.find('<div class="post-media">',pause) http = html.find('https://',media) pause = html.find('">',http) web = load_html(html[http:pause]) name = html.find('faculty',http) chu = html.find('-chula',name) print(html[name:chu]) #-------------------------------------- collg = web.find('<div class="col-lg-6">') six = web.find('+66',collg) br = web.find('<br>',six) tel = web[six:br].split() if '+66' in tel: tel.remove('+66') if '(0)' in tel: tel.remove('(0)') ans = "0 " + tel[0] + " " + tel[1][:4] print(ans+'\n') i += 1 #------------------------------------------------- def save_image(img_url, filename): img = urq.urlopen(img_url) name = open(filename,"wb") name.write(img.read()) name.close()# 6331120221 (2020-10-18 23:57) %diff = 12.03 77% def get_faculty_names(url): string=load_html(url) #สตริงของhtml startja=0 faculty=0;stop=0 #กันการวนซ้ำหลายรอบ answer=[] for i in string: startja=string.find('<h3 class="text-title-1"><a href="',stop)#topic if startja == -1:#หาไม่เจอคืนค่า-1 break faculty=string.find('Faculty of',startja) stop=string.find('</a>',faculty) if '<div class="fullwidth-content">' not in string[faculty:stop]:#กรณี school of... answer.append(string[faculty:stop]) return answer def download_faculty_images(url): #หาลิ้งค์ภาพขนาด300*188ก่อน string=load_html(url) #ภาพมักจะปะhtml ด้วย postmedia x=len(get_faculty_names(url)) ending=0 starter_sort=0 next_sort=0 i=0 while not False: starter_sort=string.find('<div class="post-media">',ending) if starter_sort ==-1 or i==x: break next_sort=string.find("1024w,",starter_sort)+7 ending=string.find(" 300w",next_sort) whathey=string[next_sort:ending].strip() malaew=whathey.split("/") save_image(whathey,malaew[-1]) i+=1 def print_faculty_numbers(url): string = load_html(url) starto = 0 end1 = 0 x = len(get_faculty_names(url)) i = 0 while not False: if i == x: break point = string.find('<div class="post-media">',end1); starto = string.find('https://',point) end1 = string.find('">',starto);web = load_html(string[starto:end1]) name = string.find('faculty',starto);wow = string.find('-chula',name) print(string[name:wow]) #-------------------------------------- #number eba = web.find('<div class="col-lg-6">');eha = web.find('+66',eba) br = web.find('<br>',eha);tel = web[eha:br].split() if '+66' in tel : tel.remove('+66') elif '(0)' in tel: tel.remove('(0)') print("0"+" "+ tel[0] +" "+ tel[1][:4]+'\n') i += 1 #------------------------------------------------- def save_image(img_url, filename): #สร้างfunction เซฟรูป #เก็บลิ้งค์เป็นบิต bit=urq.urlopen(img_url) #save image save=open(filename,"wb") save.write(bit.read()) save.close()

all: cluster #13 (3)

# 6331217521 (2020-10-18 23:39) %diff = 14.43 91% def get_faculty_names(url): total = load_html(url).split('post-entry') fac=[] for inf in total: s = inf.find('Faculty') f = inf.find('</a>') if inf[s:f] == '': pass else: fac += [inf[s:f]] return fac def download_faculty_images(url): x=[] y=load_html(url).split('\n') z=[] for line in y: if 'image/' in line and '300x188' in line and '300w' in line and 'faculty-' in line: s=line.find('https') f=line.find('jpg') if line[s:f+3] == '': pass else: x.append(line[s:f+3]) for j in range (len(x)): if j == 0: z.append(x[j]) else: if x[j] != x[j-1]: z.append(x[j]) for e in z: s=save_image(e,e.split('/')[-1]) def print_faculty_numbers(url): p=[] a=load_html(url).split('\n') for l2 in a: if '<a href="' in l2 and 'Faculty of' in l2 and 'h3' in l2: s=l2.find('https') f=l2.find('html') if l2[s:f+4] == '': pass else: p.append(l2[s:f+4]) ns=[] for m in p: m=m.split('/') for k in m: if 'faculty' in k and 'chulalongkorn' in k: s=k.find('faculty') f=k.find('-chula') ns.append(k[s:f]) num=[] for link in p: op=load_html(link) s=op.find('wpcf-field-custom-content-contact-2') f=op.find('22',s) if len(op[f:f+9]) > 0: num.append('0 '+op[f:f+9]) else: f=link.find('22') num.append('0 '+op[f:f+9]) i = 0 while i < len(ns): print(ns[i]) print(num[i]) print(' ') i += 1 #------------------------------------------------- def save_image(img_url, filename): i=urq.urlopen(img_url) img=i.read() i.close() f = open(filename,'wb') f.write(img) f.close return filename# 6331229021 (2020-10-18 23:42) %diff = 15.63 91% def get_faculty_names(url): total_inf = load_html(url).split('<div class="post-entry">') faculty = [] for inf in total_inf : a = inf.find('Faculty of ') a1 = inf.find('</a>') if inf[a:a1] == '' : pass else: faculty += [inf[a:a1]] return faculty def download_faculty_images(url): m = [] img = load_html(url).split('\n') for line in img : if 'image/' in line and '300x188' in line and 'faculty-' in line : b = line.find('https') b1 = line.find('.jpg') if line[b:b1+4] == '': pass else: m.append(line[b:b1+4]) h = [] for e in range (len(m)) : if e == 0 : h.append(m[e]) else: if m[e] != m[e-1] : h.append(m[e]) for img in h : s = save_image(img, img.split("/")[-1]) def print_faculty_numbers(url): x = [] y = load_html(url).split('\n') for lines in y : if '<a href="' in lines and 'Faculty of ' in lines and '</h3>' in lines : c = lines.find('https') c1 = lines.find('html') if lines[c:c1+4] == '': pass else: x.append(lines[c:c1+4]) namef = [] for z in x : z = z.split("/") for k in z : if 'faculty' in k and 'chulalongkorn' in k : d = k.find('faculty') d1 = k.find('-chula') namef.append(k[d:d1]) tel = [] for lk in x : o = load_html(lk) f = o.find("wpcf-field-custom-content-contact-2") q = o.find("22",f) if len(o[q:q+9]) > 0 : tel.append("0 "+o[q:q+9]) else : q = o.find("22") tel.append("0 "+o[q:q+9]) j = 0 while j < len(namef) : print(namef[j]) print(tel[j]) print(" ") j += 1 #------------------------------------------------- def save_image(img_url, filename): d = urq.urlopen(img_url) i = open(filename,"wb") i.write(d.read()) i.close return filename# 6331218121 (2020-10-18 23:43) %diff = 14.43 91% def get_faculty_names(url): faculty = [] total = load_html(url).split('<h3 class="text-title-1">') for inf in total: a = inf.find('Faculty') b = inf.find('</a></h3>') if inf[a:b] == '': pass else: faculty += [inf[a:b]] return faculty def download_faculty_images(url): x = [] y = [] total = load_html(url).split('\n') for al in total: if 'image/' in al and '300x188' in al and '300w' in al and 'faculty-' in al : s = al.find('https') f = al.find('jpg') if al[s:f+3] == '': pass else: x.append(al[s:f+3]) for i in range (len(x)): if i == 0: y.append(x[i]) elif x[i] != x[i-1]: y.append(x[i]) for e in y: s = save_image(e,e.split('/')[-1]) def print_faculty_numbers(url): p=[] a=load_html(url).split('\n') for l2 in a : if '<a href="' in l2 and 'Faculty of' in l2 and 'h3' in l2: s=l2.find('https') f=l2.find('html') if l2[s:f+4] == '': pass else: p.append(l2[s:f+4]) ns=[] for m in p: m=m.split('/') for k in m: if 'faculty' in k and 'chulalongkorn' in k: s=k.find('faculty') f=k.find('-chula') ns.append(k[s:f]) num=[] for link in p: op=load_html(link) s=op.find('wpcf-field-custom-content-contact-2') f=op.find('22',s) if len(op[f:f+9]) > 0: num.append('0 '+op[f:f+9]) else: f=link.find('22') num.append('0 '+op[f:f+9]) i = 0 while i < len(ns): print(ns[i]) print(num[i]) print(' ') i += 1 #------------------------------------------------- def save_image(img_url, filename): g = open(filename, 'wb') h = urq.urlopen(img_url) g.write(h.read()) h.close()

all: cluster #14 (2)

# 6231005721 (2020-10-18 01:44) %diff = 15.77 27% def get_faculty_names(url): result = [] text = load_html(url) while (text.find("<h3") != -1) : copy = text start = copy.find("<h3") end = copy[start:].find("</h3>") copy = copy[start:start+end] b = copy.find('html">') e = copy.find("</a") result.append(copy[b+6:e]) text = text[start+end:] return result[:-1] def download_faculty_images(url): prev = "" text = load_html(url) i = 0 while (text.find("1024w,") != -1) : copy = text start = copy.find("1024w") end = copy[start:].find(".jpg") link = copy[start+6:start+end+4].strip() if (link.find("300x188") != -1 and link != prev and link[0]=="h") : name = link[link.find("image/")+6:] #print(link,name) save_image(link,name) i += 1 text = text[start+end+1:] prev = link print ("Download",i,"facultys") def print_faculty_numbers(url): text = load_html(url) newurl = "1" while (text.find("text-title-1") != -1) : #if newurl != "" : copy = text start = copy.find("text-title-1") end = copy.find(".html") newurl = copy[start+23:end+5].strip() text = text[end+1:] if (newurl != "") : #print(newurl) k = newurl print(k[27:-30]) newtext = load_html(newurl) tel = newtext[newtext.find("+66"):] tel = tel[:13] print(0,tel[4:]) print("================") #------------------------------------------------- def save_image(img_url, filename): #img_url = "https://images.theconversation.com/files/93616/original/image-20150902-6700-t2axrz.jpg?ixlib=rb-1.1.0&q=45&auto=format&w=1000&fit=clip" urllib.request.urlretrieve(img_url, filename)# 6230176121 (2020-10-18 23:59) %diff = 15.77 17% def get_faculty_names(url): faculty_name = [] faculty_code = load_html(url) while faculty_code.find("<h3") != -1 : faculty_text = faculty_code a = faculty_text.find("<h3") b = faculty_text.find("</h3>",a) text = faculty_text[a:b+1] begin = text.find('html">') final = text.find("</a") faculty_name.append(text[begin+6:final]) faculty_code = faculty_code[a+b:] return faculty_name[:-1] def download_faculty_images(url): before = "" fac_code = load_html(url) i = 0 while fac_code.find("1024w,") != -1 : fac_text = fac_code a = fac_text.find("1024w") b = fac_text.find(".jpg",a) fac_link = fac_text[a+6:b+4].strip() if fac_link.find("300x188")!= -1 and fac_link != before and fac_link[0]== "h" : fac_name = fac_link[fac_link.find("image/")+6:] save_image(fac_link,fac_name) i += 1 fac_code = fac_code[b+1:] before = fac_link print ("Download "+i+" Faculties") def print_faculty_numbers(url): fac_code = load_html(url) new_url= "1" while fac_code.find("text-title-1") != -1 : fac_text = fac_code a = fac_text.find("text-title-1") b = fac,text.find(".html",a) new_url = fac_text[a+23:b-a+5].strip() fac_code = fac_code[b-a+1: ] if new_url != "" : i = new_url print(i[27:-30]) fac_text2 = load_html(new_url) tel = fac_text2[fac_text2.find("+66"):] tel = tel[:13] print("0"+str(tel[4:])) #------------------------------------------------- def save_image(img_url, filename): urllib.request.urlretrieve(img_url, filename)