Example of RPA-bot on Python.
Bot:
- visits webpage Fedresurs
- scrapes info about company
- downloads PDF file
- visits Kadarbitr
- scrapes info about company's bankruptcy cases
- sends info to database
- Install requirements
pip install -r requirements.txt
- Add path to Excel file with companies' inns (file main.py, line 15)
companies_inns = ExcelWorker.get_companies_inns("name_of_your_file.xlsx")
You can use file companies.xlsx from src/excel folder.
- Add data for database connection (file main.py, line 31)
db_worker = DBWorker(
user="Your user",
host="localhost",
port="Your port",
password="Your password",
database="Your database",
)
- Execute main.py
python main.py
This example works with databases 'companies' and 'cases'.
- To create Database 'companies' write text from create_companies_table.txt in database client (I used PostgreSQL)
CREATE TABLE companies (
inn CHAR ( 10 ) PRIMARY KEY,
name_fedresurs VARCHAR ( 50 ) NULL,
ogrn CHAR ( 13 ) NULL,
bankruptcy_cases TEXT [] NULL,
pdf_path VARCHAR ( 100 ) NULL,
name_full VARCHAR ( 50 ) NULL,
name VARCHAR ( 50 ) NULL,
fio VARCHAR ( 50 ) NULL,
okato VARCHAR ( 50 ) NULL,
oktmo VARCHAR ( 50 ) NULL,
okpo VARCHAR ( 50 ) NULL,
address TEXT [] NULL,
status VARCHAR ( 50 ) NULL
);
Table companies (visual, from file BD_info.xlsx)

- To create Database 'cases' write text from create_cases_table.txt in database client
CREATE TABLE cases (
case_name CHAR ( 20 ) PRIMARY KEY,
judge VARCHAR ( 100 ) NULL,
plaintiff VARCHAR ( 100 ) NULL,
applicants TEXT [] NULL,
third_parties TEXT [] NULL,
other_parties TEXT [] NULL
);
Table cases (visual, from file BD_info.xlsx)
To see results you can check data in your database or execute results.py (add data for database connection before executing)
python results.py
WTFPL: do the f* (anything) you want.