Created
March 16, 2022 21:10
-
-
Save allatambov/0b3b72f30da68602cff928511878772f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
page = requests.get("http://nplus1.ru/") | |
soup = BeautifulSoup(page.text) | |
links_raw = soup.find_all("a") | |
links_all = [] | |
for link in links_raw: | |
links_all.append(link["href"]) | |
news = [] | |
for link in links_all: | |
if "/news/" in link: | |
news.append(link) | |
news_full = [] | |
for n in news: | |
news_full.append("https://nplus1.ru" + n) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment