def wordlistgen(url, filepath):
    import requests
    from bs4 import BeautifulSoup
    print('')
    try:
        webpage = requests.get(url)
        pagedata = webpage.text
        soup = BeautifulSoup(pagedata, 'html.parser')
    except requests.exceptions.ConnectionError:
        print('\x1b[1;31m[-] ERROR CONNECTING THE SERVER...')
        exit()
    for script in soup(['script', 'style']):
        script.extract()
    text1 = soup.get_text()
    text = str(text1.strip())
    feb = text.split()
    iscount = feb.count('is')
    wascount = feb.count('was')
    arecount = feb.count('are')
    forcount = feb.count('for')
    thecount = feb.count('the')
    ofcount = feb.count('of')
    tocount = feb.count('to')
    try:
        isinit = 0
        while (isinit <= iscount):
            feb.remove('is')
            isinit = (isinit + 1)
        wasinit = 0
        while (wasinit <= wascount):
            feb.remove('was')
            wasinit = (wasinit + 1)
        areinit = 0
        while (areinit <= arecount):
            feb.remove('are')
            areinit = (areinit + 1)
        forinit = 0
        while (forinit <= forcount):
            feb.remove('for')
            forinit = (forinit + 1)
        theinit = 0
        while (theinit <= thecount):
            feb.remove('the')
            theinit = (theinit + 1)
        ofinit = 0
        while (ofinit <= ofcount):
            feb.remove('of')
            ofinit = (ofinit + 1)
        toinit = 0
        while (toinit <= tocount):
            feb.remove('to')
            toinit = (toinit + 1)
    except ValueError:
        pass
    feb.sort()
    for string in feb:
        count = feb.count(string)
        strinit = 0
        while (strinit < count):
            feb.remove(string)
            strinit = (strinit + 1)
    feb.sort()
    for i in range(len(feb)):
        try:
            file = open(filepath, 'a+')
            file.write(('\n' + feb[i]))
            file.close()
        except FileNotFoundError:
            homedir = os.environ.get('HOME')
            file = open(f'{homedir}/fr-wordlist.txt', 'a+')
            file.write(('\n' + feb[i]))
            file.close()
    if os.path.isfile(filepath):
        print('')
        print(f'[1;39m[[1;37m+[1;39m]Wordlist {filepath} successfully witten')
    else:
        print("\x1b[1;31m[-]Sorry:Path not Found!! The Path You Specified Doesn't Exist")
        print('So Saved the wordlist as fr-wordlist.txt in the HOME Directory of the current User.....')
    print('\x1b[1;37m WEB_REAMER Execution Completed. \x1b[1;33m!HAPPY HACKING! \x1b[1;34m \n')
def wordlistgen(url, filepath):
    import requests
    from bs4 import BeautifulSoup
    print()
    try:
        webpage = requests.get(url)
        pagedata = webpage.text
        soup = BeautifulSoup(pagedata, 'html.parser')
    except requests.exceptions.ConnectionError:
        print('\x1b[1;31m[-] ERROR CONNECTING THE SERVER...')
        exit()
    for script in soup(['script', 'style']):
        script.extract()
    text1 = soup.get_text()
    text = str(text1.strip())
    feb = text.split()
    iscount = feb.count('is')
    wascount = feb.count('was')
    arecount = feb.count('are')
    forcount = feb.count('for')
    thecount = feb.count('the')
    ofcount = feb.count('of')
    tocount = feb.count('to')
    try:
        isinit = 0
        while (isinit <= iscount):
            feb.remove('is')
            isinit = (isinit + 1)
        wasinit = 0
        while (wasinit <= wascount):
            feb.remove('was')
            wasinit = (wasinit + 1)
        areinit = 0
        while (areinit <= arecount):
            feb.remove('are')
            areinit = (areinit + 1)
        forinit = 0
        while (forinit <= forcount):
            feb.remove('for')
            forinit = (forinit + 1)
        theinit = 0
        while (theinit <= thecount):
            feb.remove('the')
            theinit = (theinit + 1)
        ofinit = 0
        while (ofinit <= ofcount):
            feb.remove('of')
            ofinit = (ofinit + 1)
        toinit = 0
        while (toinit <= tocount):
            feb.remove('to')
            toinit = (toinit + 1)
    except ValueError:
        pass
    feb.sort()
    for string in feb:
        count = feb.count(string)
        strinit = 0
        while (strinit < count):
            feb.remove(string)
            strinit = (strinit + 1)
    feb.sort()
    for i in range(len(feb)):
        try:
            file = open(filepath, 'a+')
            file.write(('\n' + feb[i]))
            file.close()
        except FileNotFoundError:
            homedir = os.environ.get('HOME')
            file = open(f'{homedir}/fr-wordlist.txt', 'a+')
            file.write(('\n' + feb[i]))
            file.close()
    if os.path.isfile(filepath):
        print()
        print(f'[1;39m[[1;37m+[1;39m]Wordlist {filepath} successfully witten')
    else:
        print("\x1b[1;31m[-]Sorry:Path not Found!! The Path You Specified Doesn't Exist")
        print('So Saved the wordlist as fr-wordlist.txt in the HOME Directory of the current User.....')
    print('\x1b[1;37m WEB_REAMER Execution Completed. \x1b[1;33m!HAPPY HACKING! \x1b[1;34m \n')