Skip to content

Appending a wordlist to URLS to make a webrequest

-I have a wordlist where each entry is printed on a separate line in a .txt file. -I am adding the wordslists entries onto the end of a url (nsip is listed below as a placeholder)

I am trying to take each URL and and make web requests BUT when I print i.e. full_url[0] it just gives me the whole the whole wordlist appended to the url. When I use type it tells me that full_url is a list so I am unsure as to why each element is not accessible.

any ideas how to make it so as I can easily make requests

lines = [

for line in lines:
    full_url = []
    full_url.append('' + line)



Move full_url = [] before the loop:

filename = '/Users/Desktop/common.txt'
nsip = ''
with open(filename, 'r') as file:
    full_url = []
    for line in file:
        linefinal = line.rstrip()
        full_url.append("https://" + nsip + '/' + linefinal)


which gives:

['', '', '', '', '', '', '', '', '', '']

Is that what you were after?