V
V
Vladislav2015-04-22 07:57:17
Python
Vladislav, 2015-04-22 07:57:17

How to extract page elements?

Decided to get a list of all tanks in the game from wotreplays.ru

from bs4 import BeautifulSoup as bs
import requests
soup = bs(requests.get('http://wotreplays.ru/').content)
foo = soup(tag='ul',class_='slider')
foo[0]

At the exit:
<ul class="slider">
<li ng-repeat="cbx in filter.data.tank.checkboxes" ng-show="cbx.show">
<input class="cbx" id="tank{{cbx.id}}" ng-change="filter.update('prevent tank slider update');" ng-model="cbx.checked" type="checkbox"/>
<label for="tank{{cbx.id}}">{{cbx.title}}</label>
</li>
</ul>

downloaded the site through ctrl + s browser. I look at the source code of the page, the list of tanks is in place, I open the source code by f12 - the same as bs gives out.
I am not aware of front-end technologies, so please tell me how to get the data?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Kitaev, 2015-04-22
@deliro

soup('ul', class_='slider')
Works for me.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question