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:
+11
-4
@@ -1,13 +1,20 @@
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
url = "https://uztracker.net/viewtopic.php?t=23897"
|
||||
response = requests.get(url)
|
||||
if response.status_code == 200:
|
||||
soup = BeautifulSoup(response.content, 'html.parser')
|
||||
url = "https://uztracker.net/viewtopic.php?t=23897" # placeholder url for now
|
||||
response = requests.get(url) # get da content from da url
|
||||
soup = BeautifulSoup(response.content, 'html.parser') # create bs object
|
||||
|
||||
def get_post_title():
|
||||
maintitle = soup.find(class_='tt-text')
|
||||
if maintitle:
|
||||
print("Program found:", maintitle.text)
|
||||
|
||||
else:
|
||||
print("Program not found")
|
||||
|
||||
|
||||
|
||||
if response.status_code == 200:
|
||||
get_post_title()
|
||||
|
||||
Reference in New Issue
Block a user