I don't know how to create IF with like two numbers and with "-" for example
IQ 09-
70-serie
70 84-89
80-serie
80 90-97
90-serie
90 96-99
90 99-02
but without
90-serie 80-serie
I created function like:
import time
from termcolor import colored
start_time = time.time()
url="https://www.frontlykter.no/"
def scrape(page):
url = page
soup = BeautifulSoup(requests.get(url).content, 'html.parser')
count=0
urls=[]
menu=soup.select('.ls-categories-ajax')
for a in menu[0].find_all('a', href=True):
if "-" in a.text:
object = {
"URL": a['href'],
"Name":a.text
}
# print(a['href'])
print(a.text)
count += 1
urls.append(object)
print(colored("Liczba linkow: ", "yellow"), count)
return urls
I need to modify my "if" What should I do?
Summarizing. I am looking for the last category links in the menu. That is, those with vintage car models. I don't know if it's the best idea with this "if".
I just don't want to read links like:
Citroen-> AX Only those that are in AX (they have years in the name)
Edit or maybe find all Third UL or Last child UL?