Nov-21-2019, 10:21 AM
We are creating a Virtual Scanner using Kali Linux, Metasploitable and PyCharm. I have been having problems with this code and the error message will be below the code.
#!/usr/bin/env python import requests from bs4 import BeautifulSoup def request(url): try: return requests.get("http://10.0.2.20/mutillidae/index.php?page=dns-lookup.php" + url) except requests.exceptions.ConnectionError: pass target_url = "http://10.0.2.20/mutillidae/index.php?page=dns-lookup.php" response = request(target_url) parsed_html = BeautifulSoup(response.content, features="html.parser") forms_list = parsed_html.findAll("form") # for form in forms_list: # action = form.get("action") # print(action) # method = form.get("method") # print(method) # inputs_list = form.findAll("input") # for input in inputs_list: # input_name = input.get("name") # print(input_name)This is the error message I am getting
/root/PycharmProjects/Test2/venv/bin/python /root/PycharmProjects/Test2/test2.py Traceback (most recent call last): File "/root/PycharmProjects/Test2/test2.py", line 17, in <module> parsed_html = BeautifulSoup(response.content, features="html.parser") AttributeError: 'NoneType' object has no attribute 'content' Process finished with exit code 1