B
B
Brutus12020-06-24 10:04:40
Python
Brutus1, 2020-06-24 10:04:40

How to parse tabular data into a variable using BS4?

Here is the code:

<div class="inner-content-casino"><table width="100%" bgcolor="#67717a" cellpadding="0" cellspacing="0" style="border: 1px solid #000; border-spacing: 4px 7px;"><tbody>
    <tr valign="center">
        <td>
            <table cols="3" width="100%" cellspacing="0" style="color: #ffffff; border-spacing: 0 2px;">
                <tbody><tr>
                    <td width="25%" bgcolor="#501d00" align="center" cellpadding="10">
                        <img src="https://s/light/icons/i-dot.png" alt="D">99                    </td>
                    <td width="50%" bgcolor="#f9c031" align="center" style="color: #000;">
                        Д
                    </td>
                    <td width="25%" bgcolor="#501d00" align="center" cellpadding="10">
                        <img src="https://s/light/icons/i-lave.png" alt="L">213k                    </td>
                </tr>
            </tbody></table>
        </td>
    </tr>
    <tr valign="top">
        <td>
            <table cols="3" width="100%" bgcolor="#b9cbd9" cellspacing="0" style="color: #ffffff; border-spacing: 5px 5px;">
                <tbody><tr align="center">
                <td width="33%"><img src="https://s/i/casino/1.jpg" alt=""></td><td width="33%"><img src="https://s/i/cas/5.jpg" alt=""></td><td width="33%"><img src="https://s/i/casino/10.jpg" alt=""></td>                </tr>
            </tbody></table>
        </td>
    </tr>
    <tr valign="top">
        <td bgcolor="#1d1d1d" align="center" height="42" style="border: 3px solid #1d1d1d;">
            <span class="cntr fee font13">
            Н           </span>
        </td>
    </tr>
    <tr>
        <td cellpadding="10px">
        <form action="/index.php?r=casino/roll" method="post"><input type="hidden" value="docent" name="room" id="room"><input type="hidden" value="d5b945c6210709b4e4bb145f70063408" name="token" id="token"><button class="bttn_green no-mt no-mb" type="submit" name="yt0">К за <img align="absmiddle" class="inline-icon" border="0" src="https://s/i/icons/docts.png" alt="доты"> 1</button></form><form action="/index.php?r=cas/roll" method="post"><input type="hidden" value="lave" name="room" id="room"><input type="hidden" value="d5b945c6210709b4e4bb145f70063408" name="token" id="token"><button class="bttn_green no-mt no-mb" type="submit" name="yt1">К за  <img align="absmiddle" class="inline-icon" border="0" src="https://s/i/icons/lave.png" alt="лаэ"> 10к</button></form>        </td>
    </tr>
</tbody></table>


I made soup
cas= s.get('https://si/index.php?r=cas', headers=headers)
soup = bs(cas.text, "html.parser")


so, what is next? how to write the number 99 in jp
to be
jp = 99

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question