# Defining a method for collecting the urls we want to scrape def scrape_perfume_links(url): headers = { "User-Agent": "Insert user agent", "Referer": "https://www.parfumo.com/", "Accept-Language": "en-US,en;q=0.9" } session = requests.Session() page = session.get(url, headers=headers) page.raise_for_status() soup3 = BeautifulSoup(page.content, 'html.parser') perfumes = soup3.find_all('div', class_='name') perfume_links = [] for perfume in perfumes: link = perfume.find('a')['href'] perfume_links.append(link) return perfume_links
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter