Skip to content

Commit 031a455

Browse files
committed
updated beginner series
1 parent c331827 commit 031a455

File tree

35 files changed

+864
-0
lines changed

35 files changed

+864
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Automatically created by: scrapy startproject
2+
#
3+
# For more information about the [deploy] section see:
4+
# https://scrapyd.readthedocs.io/en/latest/deploy.html
5+
6+
[scrapyd]
7+
application = scrapy_heroku.app.application
8+
9+
10+
[settings]
11+
default = chocolatescraper.settings
12+
13+
[deploy]
14+
url = http://chocolate-scraper-tut.herokuapp.com:80/
15+
project = chocolatescraper
16+

1. Beginner Series/part_2__edge_cases_and_data_processing/chocolatescraper/__init__.py

Whitespace-only changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from itemloaders.processors import TakeFirst, MapCompose
2+
from scrapy.loader import ItemLoader
3+
4+
5+
class ChocolateProductLoader(ItemLoader):
6+
7+
default_output_processor = TakeFirst()
8+
9+
price_in = MapCompose(lambda x: x.split("£")[-1])
10+
url_in = MapCompose(lambda x: 'https://www.chocolate.co.uk' + x )

0 commit comments

Comments
 (0)