Помогите найти парсер!!!

Discussion in 'Болталка' started by baton4ik, 13 Nov 2010.

  1. baton4ik

    baton4ik New Member

    Joined:
    23 Jul 2010
    Messages:
    0
    Likes Received:
    0
    Reputations:
    0
    1.URL : http://login.vk.com
    Password Type : Web Form
    User Name : мыло
    Password : пароль
    User Name Field : email
    Password Field : pass

    2.Record Index : 1
    Web Site : http://vkontakte.ru
    User Name : мыло
    Password : пароль
    User Name Field : email
    Password Field : pass
    Signons File : signons.sqlite

    чтоб былло только маил и пароль!!!

    Кто поможет от благодарю
     
  2. modestus

    modestus New Member

    Joined:
    12 Oct 2010
    Messages:
    33
    Likes Received:
    4
    Reputations:
    5
    Code:
    #!/usr/bin/env python
    #-*-encoding:UTF-8-*-
    
    #(c) modestus
    
    import re
    import os
    
    print u"Введите имя файла"
    input_file = raw_input("").strip()
    print u"Обрабатывается файл '{0}'".format(input_file)
    data = open(input_file).read()
    mail_pass = re.findall(r'''.*?(URL|Web Site)\ \:\ (.*?)\n.*?User\ Name\ \:\ (.*?)\n.*?Password\ \:\ (.*?)\n''', data, re.DOTALL|re.MULTILINE)
    for line in mail_pass:
        domain = line[1].replace("http://", "")
        domain = domain.replace(".", "_")
        open("{0}.txt".format(domain), "a").write("{0}:{1}\n".format(line[2], line[3]))
    print u"Файл '{0}' обработан".format(input_file)
    raw_input()
    
    На скорую руку накропал.
    Для работы необходим Python (www.python.org)
    При запуске спросит имя файла, который необходимо обработать.
    Для больших файлов (размер_файла>70%RAM) не годится, так как файл грузится в оперативку.
     
  3. baton4ik

    baton4ik New Member

    Joined:
    23 Jul 2010
    Messages:
    0
    Likes Received:
    0
    Reputations:
    0
    спасибо пошел разбиратся