I want to get all url from ( h2 class="" > a href="" : )
This code:
import requests from bs4 import BeautifulSoup header = {"User-Agent":"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:77.0) Gecko/20190101 Firefox/77.0"} Purl = 'https://www.tunisianet.com.tn/301-pc-portable-tunisie' req = requests.get(Purl, headers=header) soup = BeautifulSoup(req.content, 'lxml') ProductUrl = [] #find title of product showName = soup.select('h2',{'class':'h3 product-title'}) #find link of product for i in showName: ProductUrl.append(str(i.find('a'))) print(ProductUrl) for i in ProductUrl: print(i[i.find("href"):])
How can I solve it?
For example:

