mirror of
https://github.com/kristoferssolo/School.git
synced 2025-10-21 20:10:38 +00:00
Changed some folders
This commit is contained in:
parent
7aeec062ed
commit
29f3ab3bef
@ -1,27 +0,0 @@
|
|||||||
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