+1 vote
by
How to parse the name of the players with all 100 pages ?
As well Pars are somehow not working campaign finds the element
my code
import requests
from bs4 import BeautifulSoup
from lxml import html

ses = requests.Session()
page = ses.get("http://tiwar.ru/?sign_in=1")
data = {"login": "vaseaxxx", "pass": "vaseaxxx"}

auth = ses.post("http://tiwar.ru", data=data)

for i in range(1, 100):
html_text = ses.get("http://tiwar.ru/rating/sumstat/1(номер страницы от 1 до 100 все подряд)").text # Цифра в конец должно меняться до 100
soup = BeautifulSoup(html_text, 'html.parser')
names = soup.find_all('a', {"class": "block_zero"})
for name in names:
open("tiwar.txt", "a").write(name.contents[0].strip() + "\n")

5e7a4961f0fe2684920964.png
by
Tell me about 60 pages of the book is a lot or not much?

1 Answer

0 votes
by
names = soup.find_all('div',class_='block_zero')
for name in names[:-2]:
print(name.a.text)

На первой странице попадет лишняя пустая строка, нужно как-то обработать.
...