A
A
Alexey2020-11-24 10:09:33
Python
Alexey, 2020-11-24 10:09:33

How to pull data from the table of the old site where there are no classes in html and put it in the list?

Help pull out the data so that you can structure it into an array.
www.statdata.ru/nasel_regions
5fbcb149abe7a934089591.jpeg

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Dugin, 2020-11-24
@6alexey9

"Old site" = reference case for using pandas:
5fbcb51100cec009334585.png
To find out the number of the desired table on the page, you can do something like this:

for i, table in enumerate(pd.read_html('http://www.statdata.ru/nasel_regions')):
    print('-' * 100, f'>>>{i}', table, sep='\n')

S
soremix, 2020-11-24
@SoreMix

Why classes?
soup.find_all('tr')

D
Dr. Bacon, 2020-11-24
@bacon

Well, think a little, there are no classes, but there is positioning, the first td is the number, the second is the name, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question