جستجو در تالارهای گفتگو
در حال نمایش نتایج برای برچسب های 'html tags'.
1 نتیجه پیدا شد
-
Tag Finder نسخه پایتون مورد نیاز: ۳ کتابخانه های مورد نیاز: bs4, fake-useragent, requests, colorama سورس کد در پیست بین: [Hidden Content] کاربرد: پیدا کردن تمام تگ های استفاده شده در یک صفحه + تعداد import requests from bs4 import BeautifulSoup from fake_useragent import UserAgent from colorama import Fore, Back print(f"""{Fore.GREEN} ██████╗ ██╗ ██╗ █████╗ ██████╗ ██████╗ ██╗██████╗ █████╗ ███╗ ██╗ ██╔════╝ ██║ ██║██╔══██╗██╔══██╗██╔══██╗██║██╔══██╗██╔══██╗████╗ ██║ ██║ ██╗ ██║ ██║███████║██████╔╝██║ ██║██║██████╔╝███████║██╔██╗██║ ██║ ╚██╗██║ ██║██╔══██║██╔══██╗██║ ██║██║██╔══██╗██╔══██║██║╚████║ ╚██████╔╝╚██████╔╝██║ ██║██║ ██║██████╔╝██║██║ ██║██║ ██║██║ ╚███║ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚══╝ {Back.RED}{Fore.LIGHTGREEN_EX} Tag Finder {Back.RESET}{Fore.RESET} """) ua = UserAgent() headers = {'User-Agent': ua.random} tags = "a,abbr,acronym,address,applet,area,article,aside,audio,b,base,basefont,bdi,bdo,big,blockquote,body,br,button,canvas,caption,center,cite,code,col,colgroup,data,datalist,dd,del,details,dfn,dialog,dir,div,dl,dt,em,embed,fieldset,figcaption,figure,font,footer,form,frame,frameset,h1,h2,h3,h4,h5,h6,head,header,hr,html,i,iframe,img,input,ins,kbd,label,legend,li,link,main,map,mark,meta,meter,nav,noframes,noscript,object,ol,optgroup,option,output,p,param,picture,pre,progress,q,rp,rt,ruby,s,samp,script,section,select,small,source,span,strike,strong,style,sub,summary,sup,svg,table,tbody,td,template,textarea,tfoot,th,thead,time,title,tr,track,tt,u,ul,var,video,wbr".split(",") while True: try: url = input(f"{Fore.LIGHTYELLOW_EX}$ Please Enter URL: {Fore.LIGHTRED_EX}") if url.lower() == 'exit': exit() if "http" not in url and "https" not in url: url = f"[Hidden Content]}" page = requests.get(url, headers=headers).content soup = BeautifulSoup(page, 'lxml') tags_used = [(tag, len(soup.select(tag))) for tag in tags if len(soup.select(tag)) > 0] tags_used.sort(key=lambda x: x[1]) tags_used = tags_used[::-1] [print(f"{Fore.GREEN}{k}{Fore.RESET}: {v}".rjust(25)) for k,v in tags_used] print() except KeyboardInterrupt: exit() except (requests.exceptions.MissingSchema, requests.exceptions.InvalidURL): print("--> Invalid URL") except requests.exceptions.ConnectionError: print("--> Connection Error") except Exception as e: print(f"--> {e}") tag_finder.py