I am trying to get input from the user, more specifically a link. The 'https://' part is automatic, but I want the user to be asked again if he doesn't put 'www' in the beginning of the link.
This is the code by now:
import requests
from bs4 import BeautifulSoup
linkraw = input("Site-ul: ")
while linkraw[0] != "www":
print("Pune linkul incepand cu 'www' 2")
linkraw = input("Site-ul: ")
link = f'https://{linkraw}'
httprequest = requests.get(link)
if httprequest.status_code == 200:
print("Valid")
if httprequest.status_code != 200:
print("Invalid")
src = httprequest.content
soup = BeautifulSoup(src,'lxml')
print(soup.find_all('a'))