target = []: ^ IndentationError: expected an indented block after 'if' statement on line 156

Question:

Thats the code where the mistake is

if tool == ("11"):
target = []:

with open('freesec.txt','r') as f:
    for line in f:
        url = str(line.replace('n',''))
        targets.append(url)

for url in targets:
    if 'http://' in url:
        url = url.replace('http://', '')
    elif 'https://' in url:
        url = url.replace('https://', '')
    url = 'http://' + url

    response = requests.get(url + "'").text
    if 'error' in response and 'syntax' in response or 'MySQL' in response:
        print 'Gotcha!!! ' + url
    else:
        print 'No luck here :( ' + url

Thats the image of my terminal when i was fixing the tool

Asked By: Abdalmajid alawihi

||

Answers:

as per the error. You are missing the indentation.


# incorrect
if tool == ("11"):
target = []:

# correct
if tool == ("11"):
    target = []:


Reason:
Python reqires indentation to recognise blocks of code.

Answered By: D.L
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.