Получить текст между тегами - Python
Формулировка задачи:
Надо получить текст между тегами, которые выделены полосками
Пример вывода:
Games today : 26
all games : 15090
players : 16775
Max. Win today : 186.52$
Max. Win : 1068.04$
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>CSGOBIRD.US — Home page</title> <link rel="stylesheet" href="/templates/assets/styles.css?v=9999999999999999999999999999999999991411111111111111111111" /> <link rel="stylesheet" href="/templates/assets/styles/fonts.css" /> <link rel="stylesheet" href="/templates/assets/styles/tooltipster.css" /> <link rel="shortcut icon" href="/templates/assets/favicon.ico" type="image/x-icon"> <script src="/templates/assets/scripts/jquery-1.7.2.js"></script> <script src="/templates/assets/scripts/tabs.js"></script> <script src="/templates/assets/scripts/tooltipster.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <script src="/templates/assets/scripts/tabs.js"></script> <script src="/templates/assets/scripts/jquery-tipsy.js"></script> <script> $(function() { $('.north').tipsy({gravity: 'n'}); $('.south').tipsy({gravity: 's'}); $('.east').tipsy({gravity: 'e'}); $('.west').tipsy({gravity: 'w'}); }); </script> </head> <body> <link rel="stylesheet" href="/templates/assets/noty/animate.css?v=last_update1244442411112111111111111111111111" /><link rel="stylesheet" href="/templates/assets/noty/core.css?v=last_update1244442411112111111111111111111111" /><link rel="stylesheet" href="/templates/assets/tooltipster.css?v=last_update1244442411112111111111111111111111" /><link rel="stylesheet" href="/templates/assets/support.css?v=last_update1244442411112111111111111111111111" /><script src="/templates/assets/scripts/jquery.tooltipster.min.js?v=last_update1244442411112111111111111111111111"></script><script src="/templates/assets/scripts/language.js?v=last_update1244442411112111111111111111111111"></script><script src="/templates/assets/scripts/countdown.js?v=last_update1244442411112111111111111111111111"></script><script src="/templates/assets/scripts/jquery.noty.js?v=last_update1244442411112111111111111111111111"></script> <script type="text/javascript">var user_steam_id="0";var token="0";var group=0;var rub_price="65";var current_lang="en";var currency="$";main_page=true;$(document).ready(function(){$('.tooltip').tooltipster();});var lang2=lang;var timer=120;</script> <script src="/templates/assets/scripts/template.js?v=last_update1244442411112111111111111111111111"></script><script src="/templates/assets/scripts/app.js?v=last_update1244442411112111111111111111111111"></script><script src="/templates/assets/scripts/chat.js?v=last_update1244442411112111111111111111111111"></script><script src="/templates/assets/scripts/moment.js?v=last_update1244442411112111111111111111111111"></script><script src="/templates/assets/scripts/livestamp.js?v=last_update1244442411112111111111111111111111"></script><header> <div class="width"> <div class="top"> <a href="/lang/en" class="logotype"></a> <ul class="menu"> <li><a href="/">Play</a></li> <li><a href="/history">History</a></li> <li><a href="/support">Support</a></li> </ul> <a href="/auth" class="login">Login with Steam</a> </div> <div class="stat"> <!--<div id="users_online">Online<span >0</span></div>--> ================================================================================= <div>Games today<span>26</span></div> <div>all games<span>15090</span></div> <div>players<span>16775</span></div> <div>Max. Win today<span>186.52$</span></div> <div>Max. Win<span>1068.04$</span></div> ================================================================================== </div> </div> </header> <div class="container"> <div class="content"> <!-- <middle> --> <div class="top-page"> <div class="left">The more items you bet - the more chances you get.</div> <div class="right">Add <B>CSGOBIRD.US</B> to your steam nickname and receive <B>+5%</B> to possible prize.</div> <div class="number-g">GAME #<span id="game_id">0</span></div> </div> <div class="progress-i"> <div class="line" style="width: 100%;"></div> <div class="block bank">BANK: <span class="bank">5.44$</span></div> <div class="block chance">CHANCE: <span id="own_chance">0</span>%</div> <div class="total">Skins in game <span id="items_in_game">0</span></div> <div class="button"> <a href="/deposit" target="_blank">Deposit</a> <div class="help"> <div class="ico">?</div> <div class="sub">Minimal bet - <span>0.05$</span><br>Maximum deposit - <span>10</span> items.</div> </div> </div> </div> <div class="progress-t"> <div class="text">Time to start <span id="timer">02:00</span></div> <div class="line" style="width: 100%;"></div> </div> <div class="roulette" style="display:none"> <div class="winner" style="display:none"> <ul> <li><a href="/profile/"></a></li> <li>Chance: <span id="win_chance">XX</span>%</li> <li>Bank: <span id="game_bank">XX</span>$</li> </ul> </div> <div class="inbox"></div> </div> <div class="parts" > </div> <div id="game"> </div> <div class="start"><div>THE ROUND BEGINS! DEPOSIT NOW!</div></div> <!-- </middle> --> </div> </div> <footer> <div class="width"> <div class="bg-white"></div> <div class="copy">Powered by Steam, a registered trademark of Valve Corporation</div> </div> </footer> <!--<div class="chat"> <div class="chat-header">Chat</div> <div class="chat-container" style="height: 0;"> <div class="inbox"><div class="scroll"><div></div></div></div> <div class="form chat-form"> <textarea name="" id="" placeholder="Type messe..."></textarea> <input class="btn" type="submit" name="" value="SEND"> </div> </div> </div>--> <script> $('.chat-header').click(function(){ if($('.chat-container').height() < 392){ chat_height = 392; } else{ chat_height = 0; } $('.chat-container').animate({ height: chat_height + 'px' }, 100); }); </script> </body> </html>
Решение задачи: «Получить текст между тегами»
textual
Листинг программы
/Users/jabbson/.virtualenvs/py35env/bin/python /Users/jabbson/PycharmProjects/cyber/cyber.py Games today : 26 all games : 15090 players : 16775 Max. Win today : 186.52$ Max. Win : 1068.04$
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д