Слегка изменены примеры использования методов

This commit is contained in:
Ilia Miheev
2025-11-11 16:00:08 +03:00
parent a2fe484446
commit bb99e7296c
+7 -4
View File
@@ -116,9 +116,10 @@ bar.finish()
```py
from ipars import Pars
p = Pars()
nameFile = 'index.html'
p.getStaticPage('./index.html', 'https://google.com')
soup = p.returnBs4Object('./index.html')
p.getStaticPage(nameFile, 'https://google.com')
soup = p.returnBs4Object(nameFile)
allTegA = soup.find_all('a')
a1 = p.getTexts(allTegA, needFix=1)
@@ -151,12 +152,13 @@ j = JsonManager()
```py
from ipars import JsonManager
j = JsonManager()
nameFile = 'data.json'
# Записываем данные
j.dump('./data.json', [1, 2, 3, 4, 5, 6, 7])
j.dump(nameFile, [1, 2, 3, 4, 5, 6, 7])
# Получаем данные
data = j.load('./data.json')
data = j.load(nameFile)
j.pprint(data) # [1, 2, 3, 4, 5, 6, 7]
```
@@ -187,6 +189,7 @@ c = CsvManager()
from ipars import CsvManager
c = CsvManager()
nameFile = 'data.csv'
# записываем заголовки
c.writerow(nameFile, 'w', ['Количество', 'Цена', 'Итог'])