dimanche 1 novembre 2020

beautifulsoup4 keeps printing none

HTML

<div class="secondary">
            <dl>
                <div><dt>Joined</dt><dd><span class="relative-date date" title="Nov 2, 2019 9:24 pm" data-time="1572701042645" data-format="medium">Nov 2, '19</span></dd></div>
                <div><dt>Last Post</dt><dd><span class="relative-date date" title="Nov 1, 2020 4:21 pm" data-time="1604218868661" data-format="medium">18 hours</span></dd></div>
                <div><dt>Seen</dt><dd><span class="relative-date date" title="Nov 2, 2020 10:38 am" data-time="1604284735243" data-format="medium">12 mins</span></dd></div>
                <div><dt>Views</dt><dd>546</dd></div>
<!---->                <div><dt class="trust-level">Trust Level</dt><dd class="trust-level">Member</dd></div>
<!---->                <div><dt class="groups">Groups</dt>
                <dd class="groups">
                    <span><a href="/g/Programmers" id="ember47" class="group-link ember-view">Programmers</a></span>
                    <span><a href="/g/Web_Developer" id="ember49" class="group-link ember-view">Web_Developer</a></span>

<a href="/g?username=OctaLua" id="ember50" class="ember-view">                    ...
</a>                </dd>
                </div>

<!---->            </dl>
            <span id="ember51" class="ember-view">  <div id="ember53" class="user-profile-secondary-outlet follow-statistics-user ember-view"><!----></div>
</span>
          </div>

so I am trying to get the "secondary" class using the Python BeautifulSoup4 Library

page = requests.get('https://devforum.roblox.com/u/octalua').content
soup = BeautifulSoup(page, 'html.parser')
content = soup.find('div', {'class': 'secondary'})

print(content)

but whenever I print the content it keeps printing none even though I defined the class already, if you wish to check the URL its at the python code thanks.




Aucun commentaire:

Enregistrer un commentaire