Recipe-Scraper | A JS package for scraping recipes from the web | Scraper library
kandi X-RAY | Recipe-Scraper Summary
kandi X-RAY | Recipe-Scraper Summary
A JS package for scraping recipes from the web.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Recipe-Scraper
Recipe-Scraper Key Features
Recipe-Scraper Examples and Code Snippets
Community Discussions
Trending Discussions on Recipe-Scraper
QUESTION
I am trying to scrape some recipes using recipe-scrapers and Python. In the code below I am trying to add multiple url's to scrape and have the data into a CSV file in the end. The code also checks if the domain is in the list of site supported. Unfortunately this is not working.
The error displayed is :
...ANSWER
Answered 2020-May-01 at 01:03Maybe I am missing something, but as far as I can see you just have to use i
instead of site
(you are looping trough the list of sites after all).
domain = urlparse(site).netloc
and
scraper = scrape_me(site)
at least.
EDIT:
In addition to your comment - you are actually saving the last result 3 times since you are doing it in a separate for loop. The way to fix this would be to restructure your code and put everything in one for loop:
Before you start the loop:
with open('test.csv', "w", encoding="utf-8") as recipes_file:
Inside the loop:
recipe_writer = csv.writer(recipes_file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
recipe_writer.writerow([title, total_time, ingredients, instructions, image])
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Recipe-Scraper
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page