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
    Moderator

    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.