Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #42654
    Peter Queen
    Participant

    Hello Diego,

    I was running the below code using “From BeautifulSoup import BeautifulSoup” and find.ALL() but I was getting an error. I changed the code to this:

    #!/usr/bin/env python
    
    import requests
    from bs4 import BeautifulSoup
    
    def request(url):
        try:
            return requests.get(url, "http")
        except requests.exceptions.ConnectionError:
            pass
    
    target_url = "http://10.0.2.14/mutillidae/index.php?page=dns-lookup.php"
    response = request(target_url)
    
    parsed_html = BeautifulSoup(response.content, "lxml")
    forms_list = parsed_html.find_all("form")
    for form in forms_list:
        action = form.get("action")
        print(action)

    and it’s working. Is this acceptable?

    Thanks

    #42679
    Diego PérezDiego Pérez
    Participant

    Hi Peter!
    Yeah, that’s how beautifulsoup’s latest version is imported.
    Greetings!
    Diego

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Privacy Overview
ZSecurity logo featuring a stylized red letter Z

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Strictly Necessary Cookies

Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

3rd Party Cookies

This website uses Google Analytics and Linkedin to collect anonymous information such as the number of visitors to the site, and the most popular pages.

Keeping these cookies enabled helps us to improve our website.