From 5e72a51efa9aa26ea25a24615b9daea6076066d4 Mon Sep 17 00:00:00 2001 From: MickSlash Date: Sat, 23 May 2020 15:47:38 +0200 Subject: [PATCH] first commit --- lordchannel.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lordchannel.py diff --git a/lordchannel.py b/lordchannel.py new file mode 100644 index 0000000..15ed813 --- /dev/null +++ b/lordchannel.py @@ -0,0 +1,24 @@ +import bs4, requests + +url = "https://lordchannel.com/" + +def getLC(url): + res = requests.get(url) + res.raise_for_status() + soup = bs4.BeautifulSoup(res.text,"html.parser") + elementi = soup.select('#post-123 > div > div > div.fl-row.fl-row-fixed-width.fl-row-bg-photo.fl-node-5bab8763f0554.fl-row-bg-overlay > div > div > div > div > div > div > div > div > div > ul') + elems = soup.select('#post-123 > div > div > div.fl-row.fl-row-fixed-width.fl-row-bg-photo.fl-node-5bab8763f0554.fl-row-bg-overlay > div > div > div > div > div > div > div > div > div > ul > li:nth-child(6) > a') + links_with_text = [] + for a in soup.find_all('a', href=True): + if a.text: + links_with_text.append(a['href']) + return elems[0].text.strip(),elementi[0].text.strip() + + + + +elemento,articoli = getLC(url) + + +print(f"{articoli}") +# print(f"{elemento}")