Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from bs4 import BeautifulSoup
- import urllib
- maxpages = 1
- name = [];
- pwd = [];
- page = 0;
- url = "http://trialeset.ru/";
- postfix = "";
- while (page < maxpages):
- if (page > 0):
- postfix = "?start=" + str(page)
- soup = BeautifulSoup(urllib.request.urlopen(url + postfix).readall(), "lxml")
- counter = 1;
- for i in soup.select("td"):
- i = BeautifulSoup(i.string, "lxml").getText()
- if (counter % 2 != 0):
- name.append(i)
- else:
- pwd.append(i)
- counter = counter + 1
- page = page + 1
- f = open ('output.txt', 'w')
- for index,item in enumerate(name):
- n = item
- p = pwd[index]
- if ((n != "Имя пользователя") & (p != "Пароль")):
- f.write(item + " " + pwd[index] + "\n")
- f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement