-
-
Save AnderRV/08feeafc01861b10a414b0e4675a17cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def extract_content(url, soup): | |
return [{ | |
'quote': product.find(class_='text').text, | |
'author': product.find(class_='author').text | |
} for product in soup.select('.quote')] | |
def store_content(url, content): | |
for item in content: | |
if item['quote'] and item['author']: | |
list_key = f"crawling:quote:{item['author']}" | |
repo.add_to_list(list_key, item['quote']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment