mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-03 17:39:42 +02:00
make code look better and add some comments for myself
This commit is contained in:
+12
-5
@@ -1,13 +1,20 @@
|
|||||||
import requests
|
import requests
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
|
||||||
url = "https://uztracker.net/viewtopic.php?t=23897"
|
url = "https://uztracker.net/viewtopic.php?t=23897" # placeholder url for now
|
||||||
response = requests.get(url)
|
response = requests.get(url) # get da content from da url
|
||||||
if response.status_code == 200:
|
soup = BeautifulSoup(response.content, 'html.parser') # create bs object
|
||||||
soup = BeautifulSoup(response.content, 'html.parser')
|
|
||||||
|
def get_post_title():
|
||||||
maintitle = soup.find(class_='tt-text')
|
maintitle = soup.find(class_='tt-text')
|
||||||
if maintitle:
|
if maintitle:
|
||||||
print("Program found:", maintitle.text)
|
print("Program found:", maintitle.text)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("Program not found")
|
print("Program not found")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if response.status_code == 200:
|
||||||
|
get_post_title()
|
||||||
|
|
||||||
Reference in New Issue
Block a user