mirror of
https://github.com/kristoferssolo/School.git
synced 2025-10-21 20:10:38 +00:00
Fix array split into chunks
This commit is contained in:
parent
a528edea71
commit
344f36ecd8
@ -51,12 +51,6 @@ class SS:
|
||||
ids.remove("head_line") # removes first "head_line" id
|
||||
|
||||
# TODO
|
||||
# Atrašānās vieta
|
||||
# stāvs
|
||||
# istabu skaits
|
||||
# kvadratūra
|
||||
# cena
|
||||
# sērija
|
||||
# Pilns sludinājuma teksts
|
||||
# Sludinājuma ievietošanas datums
|
||||
|
||||
@ -67,7 +61,7 @@ class SS:
|
||||
|
||||
chunk_size = 6
|
||||
chunked_items_list = [items[i:i + chunk_size] for i in range(0, len(items), chunk_size)]
|
||||
# print(chunked_items_list)
|
||||
|
||||
columns = [
|
||||
"Atrašanās vieta",
|
||||
"Istabu skaits",
|
||||
@ -85,6 +79,7 @@ class SS:
|
||||
|
||||
|
||||
flats = SS("https://www.ss.com/lv/real-estate/flats/riga-region/all/sell")
|
||||
flats2 = SS("https://www.ss.com/lv/real-estate/flats/riga/all/sell/")
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
Binary file not shown.
27
task_241121/main.py
Normal file
27
task_241121/main.py
Normal file
@ -0,0 +1,27 @@
|
||||
from bs4 import BeautifulSoup
|
||||
import requests
|
||||
|
||||
url = "https://en.wikipedia.org/wiki/Husky"
|
||||
all_page = requests.get(url)
|
||||
|
||||
# print(all_page)
|
||||
|
||||
if all_page.status_code == 200:
|
||||
print(":)")
|
||||
page = BeautifulSoup(all_page.content, 'html.parser')
|
||||
found = page.find(id="Etymology")
|
||||
# print(found)
|
||||
# print(found.constents)
|
||||
# print(found.string)
|
||||
found = page.find_all(class_="mw-headline")
|
||||
# print(found)
|
||||
found = page.find_all("li", class_="interlanguage-link")
|
||||
# print(found)
|
||||
found = page.find_all("a", class_="interlanguage-link-target")
|
||||
# print(found)
|
||||
for i in found:
|
||||
# print(i.prettify())
|
||||
if i.attrs["lang"] == "ru":
|
||||
print(f"{i.attrs['lang']} \t {i.attrs['title']} \n {i.attrs['href']}")
|
||||
else:
|
||||
print(":(")
|
||||
Loading…
Reference in New Issue
Block a user